Skip to main content

Interface: Block

A live block at a fixed location in a dimension.

Properties

dimension

readonly dimension: Dimension

Dimension that owns this block.


location

readonly location: BlockVector3

Integer location of this block.


typeId

readonly typeId: string

Current namespaced block type identifier.

Methods

getState()

getState(name): string | null

Returns a serialized block-state value, or null when it is absent.

Parameters

name

string

Returns

string | null


matches()

matches(typeId): boolean

Returns whether the current block type matches an identifier.

Parameters

typeId

string

Returns

boolean


setType()

setType(typeId): void

Replaces this block with the default state of a block type.

Parameters

typeId

string

Returns

void