Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
@ApiStatus.OverrideOnly
@NotNull
abstract fun audiences(): @NotNull MutableIterable<Audience>
Link copied to clipboard
open override fun clearTitle()
Link copied to clipboard
open fun deleteMessage(@NotNull signedMessage: @NotNull SignedMessage)
open override fun deleteMessage(signature: @NotNull SignedMessage.Signature)
Link copied to clipboard
@NotNull
open override fun filterAudience(@NotNull filter: @NotNull Predicate<in Audience>): @NotNull Audience
Link copied to clipboard
open override fun forEachAudience(@NotNull action: @NotNull Consumer<in Audience>)
Link copied to clipboard
@NotNull
open operator fun <T : Any> get(@NotNull pointer: @NotNull Pointer<T>): @NotNull Optional<T>
Link copied to clipboard
abstract fun getBiome(position: Vec3i): Biome

Gets the biome at the given position.

abstract fun getBiome(x: Int, y: Int, z: Int): Biome

Gets the biome at the given x, y, and z coordinates.

Link copied to clipboard
abstract override fun getBlock(position: Vec3i): BlockState

Gets the block at the given position.

abstract override fun getBlock(x: Int, y: Int, z: Int): BlockState

Gets the block at the given coordinates.

Link copied to clipboard
open fun getBlockEntity(position: Vec3i): BlockEntity?

Gets the block entity at the given position, or returns null if there is no block entity at the given position.

abstract fun getBlockEntity(x: Int, y: Int, z: Int): BlockEntity?

Gets the block entity at the given x, y, and z coordinates, or returns null if there is no block entity at the given x, y, and z coordinates.

Link copied to clipboard
abstract fun getChunk(x: Int, z: Int): Chunk?

Gets a chunk from its chunk coordinates, or returns null if there is no chunk loaded at the given coordinates.

Link copied to clipboard
abstract fun <E : Entity> getEntitiesOfType(type: Class<E>): Collection<E>

Gets all entities of the given type contained within this container.

abstract fun <E : Entity> getEntitiesOfType(type: Class<E>, predicate: Predicate<E>): Collection<E>

Gets all entities of the given type matching the given predicate contained within this container.

Link copied to clipboard
abstract override fun getFluid(position: Vec3i): FluidState

Gets the fluid at the given position.

abstract override fun getFluid(x: Int, y: Int, z: Int): FluidState

Gets the fluid at the given coordinates.

Link copied to clipboard
abstract fun <V> getGameRule(rule: GameRule<V>): V

Gets the value of the given rule in this holder.

Link copied to clipboard
abstract fun getNearbyEntities(position: Position, range: Double): Collection<Entity>

Gets all entities that are within the given range of the given position.

abstract fun getNearbyEntities(position: Position, range: Double, callback: Consumer<Entity>)

Gets all entities that are within the given range of the given position, calling the given callback for each entity found.

Link copied to clipboard
abstract fun <E : Entity> getNearbyEntitiesOfType(position: Position, range: Double, type: Class<E>): Collection<E>

Gets all entities of the given type that are within the given range of the given position.

abstract fun <E : Entity> getNearbyEntitiesOfType(position: Position, range: Double, type: Class<E>, callback: Consumer<E>)

Gets all entities of the given type that are within the given range of the given position, calling the given callback for each entity found.

Link copied to clipboard
@Contract(value = "_, null -> _; _, !null -> !null")
@Nullable
open fun <T : Any> getOrDefault(@NotNull pointer: @NotNull Pointer<T>, @Nullable defaultValue: @Nullable T?): @Nullable T?
Link copied to clipboard
open fun <T : Any> getOrDefaultFrom(@NotNull pointer: @NotNull Pointer<T>, @NotNull defaultValue: @NotNull Supplier<out T>): @UnknownNullability T
Link copied to clipboard
open override fun hideBossBar(@NotNull bar: @NotNull BossBar)
Link copied to clipboard
abstract fun isHardcore(): Boolean

If the world is a hardcore world.

Link copied to clipboard
abstract fun isRaining(): Boolean

If this world is currently raining.

Link copied to clipboard
abstract fun isThundering(): Boolean

If this world is currently thundering (has an ongoing thunderstorm).

Link copied to clipboard
abstract fun loadChunk(x: Int, z: Int): Chunk?

Gets or loads the chunk at the given chunk coordinates, or returns null if there is no chunk at the given chunk coordinates.

Link copied to clipboard
open fun openBook(book: @NotNull Book.Builder)
open override fun openBook(@NotNull book: @NotNull Book)
Link copied to clipboard
open override fun playSound(@NotNull sound: @NotNull Sound)
open override fun playSound(@NotNull sound: @NotNull Sound, emitter: @NotNull Sound.Emitter)
open override fun playSound(@NotNull sound: @NotNull Sound, x: Double, y: Double, z: Double)
Link copied to clipboard
@NotNull
open override fun pointers(): @NotNull Pointers
Link copied to clipboard
open override fun resetTitle()
Link copied to clipboard
open fun sendActionBar(@NotNull message: @NotNull ComponentLike)
open override fun sendActionBar(@NotNull message: @NotNull Component)
Link copied to clipboard
open fun sendMessage(@NotNull message: @NotNull ComponentLike)
open fun sendMessage(@NotNull source: @NotNull Identified, @NotNull message: @NotNull Component)
open fun sendMessage(@NotNull source: @NotNull Identified, @NotNull message: @NotNull ComponentLike)
open fun sendMessage(@NotNull source: @NotNull Identity, @NotNull message: @NotNull Component)
open fun sendMessage(@NotNull source: @NotNull Identity, @NotNull message: @NotNull ComponentLike)
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
open fun sendMessage(@NotNull message: @NotNull Component, @NotNull type: @NotNull MessageType)
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
open fun sendMessage(@NotNull message: @NotNull ComponentLike, @NotNull type: @NotNull MessageType)
open fun sendMessage(@NotNull message: @NotNull ComponentLike, boundChatType: @NotNull ChatType.Bound)
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
open fun sendMessage(@NotNull source: @NotNull Identified, @NotNull message: @NotNull ComponentLike, @NotNull type: @NotNull MessageType)
@ApiStatus.ScheduledForRemoval(inVersion = "5.0.0")
open fun sendMessage(@NotNull source: @NotNull Identity, @NotNull message: @NotNull ComponentLike, @NotNull type: @NotNull MessageType)
open override fun sendMessage(@NotNull message: @NotNull Component)
open override fun sendMessage(@NotNull signedMessage: @NotNull SignedMessage, boundChatType: @NotNull ChatType.Bound)
open override fun sendMessage(@NotNull message: @NotNull Component, boundChatType: @NotNull ChatType.Bound)
open override fun sendMessage(@NotNull source: @NotNull Identified, @NotNull message: @NotNull Component, @NotNull type: @NotNull MessageType)
open override fun sendMessage(@NotNull source: @NotNull Identity, @NotNull message: @NotNull Component, @NotNull type: @NotNull MessageType)
Link copied to clipboard
open fun sendPlayerListFooter(@NotNull footer: @NotNull ComponentLike)
open override fun sendPlayerListFooter(@NotNull footer: @NotNull Component)
Link copied to clipboard
open fun sendPlayerListHeader(@NotNull header: @NotNull ComponentLike)
open override fun sendPlayerListHeader(@NotNull header: @NotNull Component)
Link copied to clipboard
open fun sendPlayerListHeaderAndFooter(@NotNull header: @NotNull ComponentLike, @NotNull footer: @NotNull ComponentLike)
open override fun sendPlayerListHeaderAndFooter(@NotNull header: @NotNull Component, @NotNull footer: @NotNull Component)
Link copied to clipboard
open override fun <T : Any> sendTitlePart(@NotNull part: @NotNull TitlePart<T>, @NotNull value: @NotNull T)
Link copied to clipboard
abstract fun setBlock(position: Vec3i, block: BlockState, flags: BlockChangeFlags): Boolean

Sets the block at the given position to the given block.

abstract fun setBlock(x: Int, y: Int, z: Int, block: BlockState, flags: BlockChangeFlags): Boolean

Sets the block at the given coordinates to the given block.

Link copied to clipboard
abstract fun <V> setGameRule(rule: GameRule<V>, value: V & Any)

Sets the value of the given rule to the given value in this holder.

Link copied to clipboard
open override fun showBossBar(@NotNull bar: @NotNull BossBar)
Link copied to clipboard
open fun showTitle(@NotNull title: @NotNull Title)
Link copied to clipboard
abstract fun <T : Entity> spawnEntity(type: EntityType<T>, position: Position): T?

Spawns an entity with the given type in this world at the given position.

Link copied to clipboard
open fun stopSound(@NotNull sound: @NotNull Sound)
open override fun stopSound(@NotNull stop: @NotNull SoundStop)
Link copied to clipboard
abstract fun unloadChunk(x: Int, z: Int)

Unloads the chunk at the specified x and z coordinates if there is a chunk loaded. If there is no chunk loaded at the coordinates, this function simply returns.

Properties

Link copied to clipboard
abstract val border: WorldBorder

This world's border.

Link copied to clipboard
abstract val chunks: Collection<Chunk>

All of the chunks currently loaded in this world.

Link copied to clipboard
abstract val difficulty: Difficulty

The difficulty of this world.

Link copied to clipboard
abstract val dimension: ResourceKey<World>

The dimension resource key for this world.

Link copied to clipboard

The dimension that this world is.

Link copied to clipboard
abstract override val entities: Collection<Entity>

All of the entities currently in this world.

Link copied to clipboard
abstract val gameMode: GameMode

The default gamemode of this world.

Link copied to clipboard
abstract val name: String

The name of this world.

Link copied to clipboard
abstract override val players: Collection<Player>

All of the players currently in this world.

Link copied to clipboard
abstract var rainLevel: Float

The level of the current rain.

Link copied to clipboard

The registry holder for this world.

Link copied to clipboard
abstract val scheduler: Scheduler

The scheduler for this world.

Link copied to clipboard
abstract val scoreboard: Scoreboard

The scoreboard for this world.

Link copied to clipboard
abstract val seed: Long

The seed of this world.

Link copied to clipboard
abstract val server: Server

The server this world was loaded on.

Link copied to clipboard
abstract val spawnLocation: Vec3i

The spawn location of this world.

Link copied to clipboard
abstract var thunderLevel: Float

The level of the current thunderstorm (0 if there is no thunderstorm going on).

Link copied to clipboard
abstract val time: Long

The current time in this world.