Package-level declarations

Types

Link copied to clipboard
annotation class DevCoreInternal

Marks declarations that are internal to DevCore and should not be used by external consumers.

Link copied to clipboard
annotation class ItemDsl

DSL marker annotation for ItemStack builder to prevent nested builder scopes.

Link copied to clipboard
class ItemStackBuilder(item: ItemStack)

A DSL builder for creating and modifying ItemStacks in a declarative way.

Link copied to clipboard
fun interface ThrowableGetter<T>

Functional interface for operations that may throw exceptions.

Link copied to clipboard

Exception thrown when a feature requires a newer Minecraft version than currently running.

Properties

Link copied to clipboard
val Location.block: Block

Gets the Block at this Location's block coordinates.

Link copied to clipboard
val Location.center: Location

Gets the center point of the block containing this Location.

Link copied to clipboard
val Plugin.coroutine: CoroutineDispatcher

Gets or creates a CoroutineDispatcher for this plugin that dispatches work on the Bukkit main thread.

Link copied to clipboard
val Plugin.scope: CoroutineScope

Gets or creates a CoroutineScope for this plugin with a SupervisorJob and Bukkit dispatcher.

Functions

Link copied to clipboard
fun Inventory.addItems(vararg items: ItemStack): List<ItemStack>

Adds multiple items to this inventory and returns any items that couldn't be added.

Link copied to clipboard
fun Location.addOffset(x: Double = 0.0, y: Double = 0.0, z: Double = 0.0): Location

Creates a new Location with the specified offsets added to this Location's coordinates.

Link copied to clipboard
inline fun <T, E : T> T.asNotNullable(): E

Casts this object to the specified type E without null safety checks.

Link copied to clipboard
inline fun <T, E : T> T.asNullable(orThrow: Boolean = false): E?

Safely casts this object to the specified type E, returning null if the cast fails.

Link copied to clipboard
fun checkVersion(target: String)

Checks if the current Minecraft server version meets the minimum required version.

Link copied to clipboard
operator fun Vector.compareTo(other: Vector): Int

Compares two Vectors lexicographically (x, then y, then z).

Link copied to clipboard
fun Inventory.countItem(material: Material): Int

Counts the total amount of items of the specified material type in this inventory.

Link copied to clipboard
operator fun Location.div(other: Double): Location

Divides all coordinates of this Location by a scalar value.

operator fun Location.div(other: Location): Location

Divides this Location's coordinates component-wise by another Location.

operator fun Location.div(vector: Vector): Location

Divides this Location's coordinates component-wise by a Vector.

operator fun Vector.div(other: Double): Vector

Divides all components of the Vector by a scalar value.

operator fun Vector.div(other: Vector): Vector

Divides two Vectors component-wise.

Link copied to clipboard
fun ItemStack.edit(action: ItemStackBuilder.() -> Unit): ItemStack

Creates a modified copy of this ItemStack using a DSL builder. The original ItemStack is not modified.

Link copied to clipboard
fun Location.face(target: Location): Location

Creates a new Location with direction set to face towards a target Location.

Link copied to clipboard
fun ConfigurationSection.getAsLocation(path: String, def: Location? = null): Location?

Retrieves a Location from the configuration section at the specified path.

Link copied to clipboard
fun ConfigurationSection.getAsVector(path: String): Vector

Retrieves a Vector from the configuration section at the specified path.

Link copied to clipboard
fun <T> getOrDefault(default: T, getter: ThrowableGetter<T>): T

Executes a ThrowableGetter and returns its result, or a default value if it throws an exception.

Link copied to clipboard
fun Inventory.hasItem(material: Material, amount: Int = 1): Boolean

Checks if this inventory contains at least the specified amount of the given material.

Link copied to clipboard
fun Inventory.isFull(): Boolean

Checks if this inventory is completely full (no empty slots).

Link copied to clipboard
fun itemStack(material: Material, amount: Int = 1, action: ItemStackBuilder.() -> Unit): ItemStack

Creates a new ItemStack using a DSL builder.

Link copied to clipboard
fun Plugin.launch(context: CoroutineContext = EmptyCoroutineContext, block: suspend CoroutineScope.() -> Unit): Job

Launches a new coroutine within this plugin's scope on the Bukkit main thread.

Link copied to clipboard
operator fun Location.minus(other: Double): Location

Subtracts a scalar value from all coordinates of this Location.

operator fun Location.minus(other: Location): Location

Subtracts another Location's coordinates from this Location.

operator fun Location.minus(vector: Vector): Location

Subtracts a Vector from this Location's coordinates.

operator fun Vector.minus(other: Double): Vector

Subtracts a scalar value from all components of the Vector.

operator fun Vector.minus(other: Vector): Vector

Subtracts two Vectors component-wise.

Link copied to clipboard
inline fun <T : Event> Plugin.on(noinline handler: (T) -> Unit)

Registers an event listener for a specific event type using a simplified syntax.

Link copied to clipboard
fun Player.playSound(sound: Sound, volume: Float = 1.0f, pitch: Float = 1.0f, category: SoundCategory = SoundCategory.MASTER)

Plays a sound to the player at their current location.

Link copied to clipboard
operator fun Location.plus(other: Double): Location

Adds a scalar value to all coordinates of this Location.

operator fun Location.plus(other: Location): Location

Adds another Location's coordinates to this Location.

operator fun Location.plus(vector: Vector): Location

Adds a Vector to this Location's coordinates.

operator fun Vector.plus(other: Double): Vector

Adds a scalar value to all components of the Vector.

operator fun Vector.plus(other: Vector): Vector

Adds two Vectors component-wise.

Link copied to clipboard
fun Entity.rangeOf(filterInRadius: Double): Collection<Entity>

Gets all entities within the specified radius from this entity's location.

fun List<Entity>.rangeOf(filterInRadius: Double, center: Entity): List<Entity>

Filters entities from this list that are within the specified radius from a center entity.

Link copied to clipboard
operator fun Location.rem(other: Location): Location

Calculates the modulo of this Location's coordinates component-wise with another Location.

operator fun Vector.rem(other: Double): Vector

Calculates the modulo of all components with a scalar value.

Link copied to clipboard
fun Inventory.removeItemSafely(material: Material, amount: Int): Boolean

Safely removes the specified amount of items of the given material from this inventory.

Link copied to clipboard
inline fun Plugin.runTaskLater(delay: Double, crossinline task: BukkitRunnable.() -> Unit): BukkitTask

Schedules a task to run after a specified delay on the main server thread.

Link copied to clipboard
inline fun Plugin.runTaskTimer(delay: Double, period: Double, crossinline task: BukkitRunnable.() -> Unit): BukkitTask

Schedules a repeating task to run at fixed intervals on the main server thread.

Link copied to clipboard
fun Collection<Entity>.send(msg: String)

Sends a string message to all entities in this collection.

fun Collection<Entity>.send(msg: Component)

Sends a Component message to all entities in this collection.

Link copied to clipboard
fun Player.showTitle(title: Component = Component.empty(), subtitle: Component = Component.empty(), fadeIn: Duration = Duration.ofMillis(500), stay: Duration = Duration.ofSeconds(3), fadeOut: Duration = Duration.ofMillis(500))

Displays a title and/or subtitle to the player with customizable timing.

Link copied to clipboard
operator fun Location.times(other: Double): Location

Multiplies all coordinates of this Location by a scalar value.

operator fun Location.times(other: Location): Location

Multiplies this Location's coordinates component-wise with another Location.

operator fun Location.times(vector: Vector): Location

Multiplies this Location's coordinates component-wise with a Vector.

operator fun Vector.times(other: Double): Vector

Multiplies all components of the Vector by a scalar value.

operator fun Vector.times(other: Vector): Vector

Multiplies two Vectors component-wise.

Link copied to clipboard
operator fun Vector.unaryMinus(): Vector

Unary minus operator that subtracts 1.0 from all components.

Link copied to clipboard
operator fun Vector.unaryPlus(): Vector

Unary plus operator that adds 1.0 to all components.

Link copied to clipboard
fun Location.with(world: World = this.world, x: Double = this.x, y: Double = this.y, z: Double = this.z, yaw: Float = this.yaw, pitch: Float = this.pitch): Location

Creates a new Location with selectively modified properties.