Skip to content

World

Represents a world.

breakBlock(pos: BlockPos, drop_items: Boolean) -> Null

Breaks the block at pos and drops the items if drop_items is true.

canSetBlock(block_pos: BlockPos) -> Boolean

Returns whether a block can be placed at block_pos.

getBlock(pos: BlockPos) -> Block

Returns the block at pos.

getTime() -> Integer

Returns the total time since the world was created.

getTimeOfDay() -> Integer

Returns the time of day.

hasRain(block_pos: BlockPos) -> Boolean

Returns whether it is raining at block_pos.

isDay() -> Boolean

Returns whether it is day.

isNight() -> Boolean

Returns whether it is night.

isRaining() -> Boolean

Returns whether it is raining.

isThundering() -> Boolean

Returns whether it is thundering.

getPlayers() -> List[Player]

Returns the players in the world.

isFlat() -> Boolean

Returns whether the world is flat.

isSleepingEnabled() -> Boolean

Returns whether sleeping is enabled.

getSeed() -> Integer

Returns the seed.

setSpawnPos(spawn_pos: BlockPos) -> Null

Sets the spawn position to spawn_pos.

setTimeOfDay(time_of_day: Integer) -> Null

Sets the time of day to time_of_day.

placeBlock(block_pos: BlockPos, block: Block) -> Null

Places the block block at block_pos.