Skip to content

Block

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
set_data

Sets the complete data for this block

set_type

Sets the type of this block

Attributes:

Name Type Description
data BlockData

Gets or sets 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 property writable

data: BlockData

Gets or sets the complete data for this block

dimension property

dimension: Dimension

Gets the dimension which contains this Block

location property

location: Location

Gets the Location of the block

type property writable

type: str

Gets or sets the type of the block.

x property

x: int

Gets the x-coordinate of this block

y property

y: int

Gets the y-coordinate of this block

z property

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.

type str

Get the block type represented by this block data.

block_states property

block_states: dict[str, bool | str | int]

Gets the block states for this block.

type property

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 class-attribute

DOWN: BlockFace

EAST class-attribute

EAST: BlockFace

NORTH class-attribute

NORTH: BlockFace

SOUTH class-attribute

SOUTH: BlockFace

UP class-attribute

WEST class-attribute

WEST: BlockFace

name property

name: str

value property

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 property

block: Block

Gets the block represented by this block state.

data property writable

data: BlockData

Gets or sets the data for this block state.

dimension property

dimension: Dimension

Gets the dimension which contains the block represented by this block state.

location property

location: Location

Gets the location of this block state.

type property writable

type: str

Gets or sets the type of this block state.

x property

x: int

Gets the x-coordinate of this block state.

y property

y: int

Gets the y-coordinate of this block state.

z property

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.