Optional
storage: BlockLevelStorageReadonly
dimensionThe dimension the block is in.
Whether the block is currently ticking or not. If true, this means the behaviors of the block are being processed. If false, this means the block currently isn't within the simulation distance from a player.
Readonly
positionThe position of the block. (x, y, z)
Protected
Readonly
serenityThe serenity instance of the server.
The direction the block is facing.
The block identifier of the block. (minecraft:stone, minecraft:oak_log, minecraft:air, etc.)
The block identifier of the block. (minecraft:stone, minecraft:oak_log, minecraft:air, etc.)
Whether or not the block is air. Usaully if the block is air, it is not cached in the dimension.
Whether or not the block is lava logged.
Whether or not the block is lava logged.
Whether or not the block is liquid.
Whether or not the block is loggable. Depening on the value, this will determine if the block can be logged with a fluid type block.
Whether or not the block is solid. Depening on the value, this will determine if entities can pass through the block.
Whether or not the block is waterlogged.
Whether or not the block is waterlogged.
The current permutation of the block. The permutation contains the specific state of the block, which determines the block's appearance and behavior. The permutation is a combination of the block type and the block state.
The current permutation of the block. The permutation contains the specific state of the block, which determines the block's appearance and behavior. The permutation is a combination of the block type and the block state.
Gets the current world the block is in.
Gets the block above this block.
Optional
steps: numberThe amount of steps to go up.
Adds a dynamic property to the block.
The key of the dynamic property to add.
The dynamic property to add.
Adds a trait to the block.
The trait instance that was added to the block.
Gets the block below this block.
Optional
steps: numberThe amount of steps to go down.
Deletes a tag entry from the level storage.
The name of the tag entry to delete.
Whether the tag entry was deleted or not.
Destroys the block, dropping its loot if specified.
Optional
options: Partial<BlockDestroyOptions>The options for destroying the block.
Whether the block was destroyed successfully; otherwise, false.
Gets the block to the east of this block.
Optional
steps: numberThe amount of steps to go east.
Gets the corresponding block next to a given block face of the block.
The face of the block.
Get all dynamic properties of the block.
A map of all dynamic properties of the block.
Get all traits currently applied to the block.
An array of all traits currently applied to the block.
Get the time it takes to break the block.
Optional
itemStack: null | ItemStackThe item stack used to break the block.
The time it takes to break the block.
Get the collision box of the block.
The collision box of the block.
Gets the specified dynamic property from the block.
The key of the dynamic property to get from the block.
The dynamic property if it exists, otherwise null.
Get the amount of friction of the block.
The amount of friction of the block.
Get the hardness of the block.
The hardness level of the block.
Gets the item stack of the block.
Optional
options: Partial<ItemStackOptions>The options for the item stack.
The item stack of the block.
Get the amount of light emitted by the block.
The amount of light emitted by the block.
Gets the current permutation of the block.
Get the selection box of the block.
The selection box of the block.
Get the a specific state of the block.
The key of the state to get.
The value of the state.
Get the nbt level storage for the block.
The current level storage of the block.
Get a specific tag entry from the level storage.
The name of the tag entry to get.
The tag entry if it exists, otherwise null.
Gets the tool type required to break the block.
Gets the specified trait from the block.
The trait to get from the block
The trait if it exists, otherwise null
Gets the specified trait from the block.
The trait to get from the block
The trait if it exists, otherwise null
Whether the block has the specified dynamic property.
The key of the dynamic property to check for.
Whether the block has the dynamic property.
Check if the block has a specific state.
The key of the state to check for.
Whether the block has the state or not.
Check if the level storage has a specific tag entry.
The name of the tag entry to check for.
Whether the tag entry exists or not.
Whether the block has the specified trait.
The trait to check for
Whether the block has the trait
Interact with the block, calling the onInteract method of the block traits.
Optional
options: Partial<BlockInteractionOptions>Gets the block to the north of this block.
Optional
steps: numberThe amount of steps to go north.
Pushes multiple tag entries to the level storage.
The tag entries to push.
Removes the specified dynamic from the block.
The key of the dynamic to remove.
Removes the specified trait from the block.
The trait to remove
Sends the current level storage to all players in the dimension.
Sets the specified dynamic property to the block.
The key of the dynamic property to set.
The dynamic property to set.
Sets the permutation of the block.
The permutation to set the block to.
Optional
storage: BlockLevelStorageThe level storage to load into the block.
Sets the state of the block.
The key of the state to set.
The value of the state to set.
Set a specific tag entry in the level storage.
The name of the tag entry to set.
The tag entry to set.
Gets the block to the south of this block.
Optional
steps: numberThe amount of steps to go south.
Spawns the loot that is associated with the block.
Updates the block and surrounding blocks.
Whether to update the surrounding blocks.
The source of the update.
Gets the block to the west of this block.
Optional
steps: numberThe amount of steps to go west.
Block is a class the represents an instance of a block in a dimension of a world. The Block instance contains its position, dimension, type, permutation, components, traits, and nbt data. Blocks can be interacted with, destroyed, and have additional behavior added to them through traits.