Level
endstone.level
¶
Classes:
| Name | Description |
|---|---|
Chunk |
Represents a chunk of blocks. |
Dimension |
Represents a dimension within a |
Level |
Represents a level, which may contain actors, chunks and blocks. |
Location |
Represents a 3-dimensional location in a dimension within a level. |
Chunk
¶
Dimension
¶
Represents a dimension within a Level.
Methods:
| Name | Description |
|---|---|
drop_item |
Drops an item at the specified |
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 |
Attributes:
| Name | Type | Description |
|---|---|---|
NETHER |
Identifier[Dimension]
|
|
OVERWORLD |
Identifier[Dimension]
|
|
THE_END |
Identifier[Dimension]
|
|
actors |
list[Actor]
|
A list of all actors currently residing in this dimension. |
id |
Identifier[Dimension]
|
The identifier of this dimension. |
level |
Level
|
The level to which this dimension belongs. |
loaded_chunks |
list[Chunk]
|
A list of all loaded |
translation_key |
str
|
The translation key, suitable for use in a translation component. |
OVERWORLD
class-attribute
instance-attribute
¶
OVERWORLD: Identifier[Dimension] = 'minecraft:overworld'
translation_key
property
¶
translation_key: str
The translation key, suitable for use in a translation component.
drop_item
¶
get_block_at
¶
get_highest_block_at
¶
get_highest_block_y_at
¶
spawn_actor
¶
Level
¶
Represents a level, which may contain actors, chunks and blocks.
Methods:
| Name | Description |
|---|---|
get_dimension |
Gets the dimension with the given id. |
Attributes:
| Name | Type | Description |
|---|---|---|
actors |
list[Actor]
|
A list of all actors currently residing in this level. |
dimensions |
list[Dimension]
|
A list of all dimensions within this level. |
name |
str
|
The unique name of this level. |
seed |
int
|
The Seed for this level. |
time |
int
|
The relative in-game time of this level. |
get_dimension
¶
Location
¶
Location(
dimension: Dimension,
x: float,
y: float,
z: float,
pitch: float = 0.0,
yaw: float = 0.0,
)
Represents a 3-dimensional location in a dimension within a level.
Methods:
| Name | Description |
|---|---|
distance |
Get the distance between this location and another. |
distance_squared |
Get the squared distance between this location and another. |
normalize_pitch |
Normalizes the given pitch angle to a value between |
normalize_yaw |
Normalizes the given yaw angle to a value between |
zero |
Zero this location's components. Not world-aware. |
Attributes:
| Name | Type | Description |
|---|---|---|
block |
Block
|
The block at the represented location. |
block_x |
int
|
The floored value of the X component, indicating the block that this location is contained with. |
block_y |
int
|
The floored value of the Y component, indicating the block that this location is contained with. |
block_z |
int
|
The floored value of the Z component, indicating the block that this location is contained with. |
dimension |
Dimension
|
The |
direction |
Vector
|
A unit-vector pointing in the direction that this |
length |
float
|
The magnitude of the location, defined as |
length_squared |
float
|
The magnitude of the location squared. |
pitch |
float
|
The pitch of this location, measured in degrees. |
x |
float
|
The x-coordinate of this location. |
y |
float
|
The y-coordinate of this location. |
yaw |
float
|
The yaw of this location, measured in degrees. |
z |
float
|
The z-coordinate of this location. |
block_x
property
¶
block_x: int
The floored value of the X component, indicating the block that this location is contained with.
block_y
property
¶
block_y: int
The floored value of the Y component, indicating the block that this location is contained with.
block_z
property
¶
block_z: int
The floored value of the Z component, indicating the block that this location is contained with.
direction
property
writable
¶
direction: Vector
A unit-vector pointing in the direction that this Location is facing.
length
property
¶
length: float
The magnitude of the location, defined as sqrt(x^2+y^2+z^2).
Not world-aware and orientation independent.
length_squared
property
¶
length_squared: float
The magnitude of the location squared.
Not world-aware and orientation independent.