endstone.block
Classes relating to the blocks in a world, including special states.
Classes relating to the blocks in a world, including special states.
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. |
BlockType | Represents a block type. |
classBlock
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. |
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 |
attrdataproperty
data: BlockDataGets the complete data for this block
attrdimensionproperty
dimension: DimensionGets the dimension which contains this Block
attrlocationproperty
location: LocationGets the Location of the block
attrtypeproperty
type: strGets or sets the type of the block.
attrxproperty
x: intGets the x-coordinate of this block
attryproperty
y: intGets the y-coordinate of this block
attrzproperty
z: intGets the z-coordinate of this block
methcapture_state
capture_state() -> BlockStateCaptures 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.
methset_data
Sets the complete data for this block
methset_type
Sets the type of this block
classBlockData
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. |
attrblock_statesproperty
Gets the block states for this block.
attrruntime_idproperty
runtime_id: intGets the runtime id for this block.
attrtypeproperty
type: strGet the block type represented by this block data.
classBlockFace
Bases: Enum
BlockFace()classBlockState
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. |
attrblockproperty
block: BlockGets the block represented by this block state.
attrdataproperty
data: BlockDataGets or sets the data for this block state.
attrdimensionproperty
dimension: DimensionGets the dimension which contains the block represented by this block state.
attrlocationproperty
location: LocationGets the location of this block state.
attrtypeproperty
type: strGets or sets the type of this block state.
attrxproperty
x: intGets the x-coordinate of this block state.
attryproperty
y: intGets the y-coordinate of this block state.
attrzproperty
z: intGets the z-coordinate of this block state.
methupdate
Attempts to update the block represented by this state.
classBlockType
BlockType()Represents a block type.
Methods
| Name | Description |
|---|---|
create_block_data | Creates a new BlockData instance for this block type, with all properties initialized to defaults. |
get | Attempts to get the BlockType with the given name. |
Attributes
| Name | Type | Description |
|---|---|---|
has_item_type | bool | Returns true if this BlockType has a corresponding ItemType. |
id | str | Return the identifier of this block type. |
translation_key | str | Get the translation key, suitable for use in a translation component. |
attrhas_item_typeproperty
has_item_type: boolReturns true if this BlockType has a corresponding ItemType.
attridproperty
id: strReturn the identifier of this block type.
attrtranslation_keyproperty
translation_key: strGet the translation key, suitable for use in a translation component.
methcreate_block_data
create_block_data() -> BlockDataCreates a new BlockData instance for this block type, with all properties initialized to defaults.
methgetstaticmethod
Attempts to get the BlockType with the given name.