Skip to Content
⚠ Under Construction
ReferencePython APIendstone.block

endstone.block

Classes:

NameDescription
BlockRepresents a block.
BlockDataRepresents the data related to a live block
BlockFace
BlockStateRepresents a captured state of a block, which will not update automatically.

Block

Represents a block.

Methods:

NameDescription
capture_stateCaptures 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_relativeGets the block at the given offsets
Gets the block at the given distance of the given face
set_dataSets the complete data for this block
set_typeSets the type of this block

Attributes:

NameTypeDescription
dataBlockDataGets the complete data for this block
dimensionDimensionGets the dimension which contains this Block
locationLocationGets the Location of the block
typestrGets or sets the type of the block.
xintGets the x-coordinate of this block
yintGets the y-coordinate of this block
zintGets 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:

NameTypeDescription
block_statesdict[str, bool | str | int]Gets the block states for this block.
runtime_idintGets the runtime id for this block.
typestrGet 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:

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:

NameDescription
updateAttempts to update the block represented by this state.

Attributes:

NameTypeDescription
blockBlockGets the block represented by this block state.
dataBlockDataGets or sets the data for this block state.
dimensionDimensionGets the dimension which contains the block represented by this block state.
locationLocationGets the location of this block state.
typestrGets or sets the type of this block state.
xintGets the x-coordinate of this block state.
yintGets the y-coordinate of this block state.
zintGets 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.

Last updated on