Skip to content

Level

endstone.level

Classes:

Name Description
Chunk

Represents a chunk of blocks.

Dimension

Represents a dimension within a Level.

Level
Location

Represents a 3-dimensional location in a dimension within a level.

Chunk

Represents a chunk of blocks.

Attributes:

Name Type Description
dimension Dimension

Gets the dimension containing this chunk

level Level

Gets the level containing this chunk

x int

Gets the X-coordinate of this chunk

z int

Gets the Z-coordinate of this chunk

dimension property

dimension: Dimension

Gets the dimension containing this chunk

level property

level: Level

Gets the level containing this chunk

x property

x: int

Gets the X-coordinate of this chunk

z property

z: int

Gets the Z-coordinate of this chunk

Dimension

Represents a dimension within a Level.

Classes:

Name Description
Type

Represents various dimension types.

Methods:

Name Description
drop_item

Drops an item at the specified Location

get_block_at
get_highest_block_at
get_highest_block_y_at

Gets the highest non-empty (impassable) coordinate at the given coordinates.

spawn_actor

Creates an actor at the given Location

Attributes:

Name Type Description
CUSTOM
NETHER
OVERWORLD
THE_END
actors list[Actor]

Get a list of all actors in this dimension

level Level

Gets the level to which this dimension belongs

loaded_chunks list[Chunk]

Gets a list of all loaded Chunks

name str

Gets the name of this dimension

type Type

Gets the type of this dimension

CUSTOM class-attribute instance-attribute

CUSTOM = CUSTOM

NETHER class-attribute instance-attribute

NETHER = NETHER

OVERWORLD class-attribute instance-attribute

OVERWORLD = OVERWORLD

THE_END class-attribute instance-attribute

THE_END = THE_END

actors property

actors: list[Actor]

Get a list of all actors in this dimension

level property

level: Level

Gets the level to which this dimension belongs

loaded_chunks property

loaded_chunks: list[Chunk]

Gets a list of all loaded Chunks

name property

name: str

Gets the name of this dimension

type property

type: Type

Gets the type of this dimension

Type

Bases: Enum

Represents various dimension types.

Attributes:

Name Type Description
CUSTOM
NETHER
OVERWORLD
THE_END
CUSTOM class-attribute instance-attribute
CUSTOM = 999
NETHER class-attribute instance-attribute
NETHER = 1
OVERWORLD class-attribute instance-attribute
OVERWORLD = 0
THE_END class-attribute instance-attribute
THE_END = 2

drop_item

drop_item(location: Location, item: ItemStack) -> Item

Drops an item at the specified Location

get_block_at

get_block_at(location: Location) -> Block

Gets the Block at the given Location

get_block_at(x: int, y: int, z: int) -> Block

Gets the Block at the given coordinates

get_highest_block_at

get_highest_block_at(location: Location) -> Block

Gets the highest non-empty (impassable) block at the given Location.

get_highest_block_at(x: int, z: int) -> Block

Gets the highest non-empty (impassable) block at the given coordinates.

get_highest_block_y_at

get_highest_block_y_at(x: int, z: int) -> int

Gets the highest non-empty (impassable) coordinate at the given coordinates.

spawn_actor

spawn_actor(location: Location, type: str) -> Actor

Creates an actor at the given Location

Level

Methods:

Name Description
get_dimension

Gets the dimension with the given name.

Attributes:

Name Type Description
actors list[Actor]

Get a list of all actors in this level

dimensions list[Dimension]

Gets a list of all dimensions within this level.

name str

Gets the unique name of this level

seed int

Gets the Seed for this level.

time int

Gets and sets the relative in-game time on the server

actors property

actors: list[Actor]

Get a list of all actors in this level

dimensions property

dimensions: list[Dimension]

Gets a list of all dimensions within this level.

name property

name: str

Gets the unique name of this level

seed property

seed: int

Gets the Seed for this level.

time property writable

time: int

Gets and sets the relative in-game time on the server

get_dimension

get_dimension(name: str) -> Dimension

Gets the dimension with the given name.

Location

Location(
    x: float,
    y: float,
    z: float,
    pitch: float = 0.0,
    yaw: float = 0.0,
    dimension: Dimension = None,
)

Bases: Vector

Represents a 3-dimensional location in a dimension within a level.

Attributes:

Name Type Description
block_x int

Gets the floored value of the X component, indicating the block that this location is contained with.

block_y int

Gets the floored value of the Y component, indicating the block that this location is contained with.

block_z int

Gets the floored value of the Z component, indicating the block that this location is contained with.

dimension Dimension

The Dimension that contains this position

pitch float

The pitch of this location, measured in degrees.

yaw float

The yaw of this location, measured in degrees.

block_x property

block_x: int

Gets the floored value of the X component, indicating the block that this location is contained with.

block_y property

block_y: int

Gets the floored value of the Y component, indicating the block that this location is contained with.

block_z property

block_z: int

Gets the floored value of the Z component, indicating the block that this location is contained with.

dimension property writable

dimension: Dimension

The Dimension that contains this position

pitch property writable

pitch: float

The pitch of this location, measured in degrees.

yaw property writable

yaw: float

The yaw of this location, measured in degrees.