Creates a new custom block type.
The identifier of the block type.
Optionalproperties: Partial<CustomBlockProperties>The properties of the block type.
ReadonlyairWhether the block type is air.
ReadonlydropsThe default item drops of the block type.
ReadonlyidentifierThe identifier of the block type.
ReadonlyliquidWhether the block type is liquid.
ReadonlyloggableWhether the block type is loggable.
ReadonlynetworkThe network ID of the custom block type.
ReadonlypermutationsThe default permutations of the block type.
ReadonlypropertiesThe nbt properties definition of the block type. This contains the vanilla component definitions.
ReadonlysolidWhether the block type is solid.
ReadonlystatesThe state values of the block type.
ReadonlytraitsThe traitsthat are bound to the block type. These traits are used to define custom behavior for the block type.
Protected StaticnetworkStatic ReadonlytypesA 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.
Creates a new block permutation for the block type.
The state of the block. { [key: string]: string | number | boolean }
Optionalcomponents: Partial<BlockTypeComponentCollection>The components of the block permutation.
Optionalquery: stringThe molang query for the block permutation. If not provided, the query will be generated from the state.
The block permutation that was created using the state definition.
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 material sound of the block type.
The material sound of the block type.
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.
Optionalstate: 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.
Get the material sound of the block type.
The material sound to set for the block type.
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.
StaticgetGet the block type from the registry.
StaticgetGet 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