Represents a block in a dimension. A block represents a unique X, Y, and Z within a dimension and get/sets the state of the block at that location. This type was significantly updated in version 1.17.10.21.

Constructors

Properties

dimension: Dimension

Returns the dimension that the block is within.

isAir: boolean

Returns true if this block is an air block (i.e., empty space).

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

isLiquid: boolean

Returns true if this block is a liquid block - (e.g., a water block and a lava block are liquid, while an air block and a stone block are not. Water logged blocks are not liquid blocks).

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

isSolid: boolean

Returns true if this block is solid and impassible - (e.g., a cobblestone block and a diamond block are solid, while a ladder block and a fence block are not).

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

isValid: boolean

Returns true if this reference to a block is still valid (for example, if the block is unloaded, references to that block will no longer be valid.)

isWaterlogged: boolean

Returns or sets whether this block has water on it.

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

location: Vector3

Coordinates of the specified block.

This property can throw when used.

permutation: BlockPermutation

Additional block configuration data that describes the block.

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

type: BlockType

Gets the type of block.

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

typeId: string

Identifier of the type of block for this block. Warning: Vanilla block names can be changed in future releases, try using 'Block.matches' instead for block comparison.

This property can throw when used.

LocationInUnloadedChunkError

LocationOutOfWorldBoundariesError

x: number

X coordinate of the block.

y: number

Y coordinate of the block.

z: number

Z coordinate of the block.

Methods