endstone.block
Classes:
Name | Description |
---|---|
Block | Represents a block. |
BlockData | Represents the data related to a live block |
BlockFace | |
BlockState | Represents a captured state of a block, which will not update automatically. |
Block
Represents a block.
Methods:
Name | Description |
---|---|
capture_state | Captures the current state of this block. The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state. |
get_relative | Gets the block at the given offsets Gets the block at the given distance of the given face |
set_data | Sets the complete data for this block |
set_type | Sets the type of this block |
Attributes:
Name | Type | Description |
---|---|---|
data | BlockData | Gets the complete data for this block |
dimension | Dimension | Gets the dimension which contains this Block |
location | Location | Gets the Location of the block |
type | str | Gets or sets the type of the block. |
x | int | Gets the x-coordinate of this block |
y | int | Gets the y-coordinate of this block |
z | int | Gets the z-coordinate of this block |
data
data: BlockData
Gets the complete data for this block
dimension
dimension: Dimension
Gets the dimension which contains this Block
location
location: Location
Gets the Location of the block
type
type: str
Gets or sets the type of the block.
x
x: int
Gets the x-coordinate of this block
y
y: int
Gets the y-coordinate of this block
z
z: int
Gets the z-coordinate of this block
capture_state
capture_state() -> BlockState
Captures the current state of this block. The returned object will never be updated, and you are not guaranteed that (for example) a sign is still a sign after you capture its state.
get_relative
get_relative(offset_x:int, offset_y:int, offset_z:int) -> Block
Gets the block at the given offsets
get_relative(face:BlockFace, distance:int = 1) -> Block
Gets the block at the given distance of the given face
set_data
set_data(data:BlockData, apply_physics:bool = True) -> None
Sets the complete data for this block
set_type
set_type(type:str, apply_physics:bool = True) -> None
Sets the type of this block
BlockData
Represents the data related to a live block
Attributes:
Name | Type | Description |
---|---|---|
block_states | dict[str, bool | str | int] | Gets the block states for this block. |
runtime_id | int | Gets the runtime id for this block. |
type | str | Get the block type represented by this block data. |
block_states
block_states: dict[str, bool | str | int]
Gets the block states for this block.
runtime_id
runtime_id: int
Gets the runtime id for this block.
type
type: str
Get the block type represented by this block data.
BlockFace
BlockFace(value:int)
Attributes:
Name | Type | Description |
---|---|---|
DOWN | BlockFace | |
EAST | BlockFace | |
NORTH | BlockFace | |
SOUTH | BlockFace | |
UP | BlockFace | |
WEST | BlockFace | |
name | str | |
value | int |
DOWN
DOWN: BlockFace
EAST
EAST: BlockFace
NORTH
NORTH: BlockFace
SOUTH
SOUTH: BlockFace
UP
UP: BlockFace
WEST
WEST: BlockFace
name
name: str
value
value: int
BlockState
Represents a captured state of a block, which will not update automatically.
Methods:
Name | Description |
---|---|
update | Attempts to update the block represented by this state. |
Attributes:
Name | Type | Description |
---|---|---|
block | Block | Gets the block represented by this block state. |
data | BlockData | Gets or sets the data for this block state. |
dimension | Dimension | Gets the dimension which contains the block represented by this block state. |
location | Location | Gets the location of this block state. |
type | str | Gets or sets the type of this block state. |
x | int | Gets the x-coordinate of this block state. |
y | int | Gets the y-coordinate of this block state. |
z | int | Gets the z-coordinate of this block state. |
block
block: Block
Gets the block represented by this block state.
data
data: BlockData
Gets or sets the data for this block state.
dimension
dimension: Dimension
Gets the dimension which contains the block represented by this block state.
location
location: Location
Gets the location of this block state.
type
type: str
Gets or sets the type of this block state.
x
x: int
Gets the x-coordinate of this block state.
y
y: int
Gets the y-coordinate of this block state.
z
z: int
Gets the z-coordinate of this block state.
update
update(force:bool = False, apply_physics:bool = True) -> bool
Attempts to update the block represented by this state.