gdpc.block¶
Provides the Block class, which represents a Minecraft block.
- class Block¶
A Minecraft block.
Block states can be stored in
states, and block entity data can be stored indataas an SNBT string.If
idis an empty string or None, the block represents “nothing”. Placing such a block has no effect. This is opposed to blocks of air, which do replace existing blocks. Nothing-blocks can be useful in block palettes.The transform methods modify a number of orientation-related block states. These are:
axis
facing
half
rotation
Other orientation-related block states are currently not supported by the transformation system, but support may be added in a future version.
-
__init__(id: str | None =
'minecraft:stone', states: dict[str, str] | None =None, data: str | None =None)¶ Constructs a Block instance with the given properties.
-
transform(rotation: int =
0, flip: Vec3bLike =bvec3(0, 0, 0)) None¶ Transforms this block.
Flips first, rotates second.
-
transformed(rotation: int =
0, flip: Vec3bLike =bvec3(0, 0, 0)) Block¶ Returns a transformed copy of this block.
Flips first, rotates second.
- stateString() str¶
Returns a string containing the block states of this block, including the outer brackets.
-
__hash__ =
None¶
-
__match_args__ =
('id', 'states', 'data')¶