Create a new block type.
The identifier of the block type.
Optional
properties: Partial<BlockTypeProperties>The properties of the block type.
Readonly
airWhether the block type is air.
Readonly
dropsThe default item drops of the block type.
Readonly
identifierThe identifier of the block type.
Readonly
liquidWhether the block type is liquid.
Readonly
loggableWhether the block type is loggable.
Readonly
permutationsThe default permutations of the block type.
Readonly
propertiesThe nbt properties definition of the block type. This contains the vanilla component definitions.
Readonly
solidWhether the block type is solid.
Readonly
statesThe state values of the block type.
Readonly
traitsThe traitsthat are bound to the block type. These traits are used to define custom behavior for the block type.
Static
Readonly
typesA collective registry of all block types.
The vanilla components of the block permutation. (hardness, friction, lighting, etc.) These components are active on the client-end when the query condition is met. These components will be used gobally for all permutations, unless a permutation has a definition that overrides it.
Whether the block type is component based. This is determined by the presence of any components in the block type.
Add tags to the block type.
The tags to add.
The block type instance.
Checks if the block type is destructible with a pickaxe. This applies a speed boost to the pickaxe when mining the block.
True if the block type is destructible with a pickaxe, false otherwise.
Checks if the block type is destructible with a shovel. This applies a speed boost to the shovel when mining the block.
True if the block type is destructible with a shovel, false otherwise.
Gets the network definition of the block type, which is used to send the block type to the client.
The network block type definition.
Get the permutation of the block type.
Optional
state: BlockState[T]The state of the block type.
Get the tags of the block type.
An array of tags.
Check if the block type has any requirements to be mined.
True if the block type has any requirements, false otherwise.
Check if the block type has a tag.
The tag to check.
True if the block type has the tag, false otherwise.
Register a trait to the block type.
The trait to register.
The block type instance.
Remove tags from the block type.
The tags to remove.
The block type instance.
Set the tags of the block type.
The tags to set.
The block type instance.
Unregister a trait from the block type.
The trait to unregister.
The block type instance.
Static
getGet the block type from the registry.
Static
getGet all block types from the registry.
BlockType represents a block type in the game, which hold all possible permutations the block can have.
Example Usage