Optional
properties: Partial<BlockProperties>Readonly
dimensionThe dimension the block is in.
Readonly
dyanamicThe dynamic properties that are attached to the block. Dynamic properties is additional data that is attached to the block and will be saved with the world database. These are usaully used by traits to store additional data, but can be used by other systems as well.
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
nbtThe nbt data that is attached to the block. Nbt data is additional data that is attached to the block and will be saved with the world database. The format of the nbt data is exactly the same as the nbt format of vanilla Minecraft. This data is used to apply additional metadata to the block. (Custom Name, Chest Open/Closed, etc.)
Readonly
positionThe position of the block. (x, y, z)
Protected
Readonly
serenityThe serenity instance of the server.
Readonly
traitsThe traits that are attached to the block. Traits add additional behavior to the block and only the trait identifier will be saved with the world database. Traits generally use components or nbt to store additional data.
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.
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 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.
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.
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>Loads the block data from a block entry object.
The world the block is in.
The block entry object to load the block data from.
Whether to overwrite the block data.
Gets the block to the north of this block.
Optional
steps: numberThe amount of steps to go north.
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
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
entry: BlockEntryThe block entry to load the block data from.
Sets the state of the block.
The key of the state to set.
The value of the state 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.