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.

Hierarchy

  • Block

Constructors

  • Returns Block

Properties

dimension: Dimension

Remarks

Returns the dimension that the block is within.

location: Vector3

Remarks

Coordinates of the specified block.

Throws

This property can throw when used.

permutation: BlockPermutation

Remarks

Additional block configuration data that describes the block.

Throws

This property can throw when used.

x: number

Remarks

X coordinate of the block.

y: number

Remarks

Y coordinate of the block.

z: number

Remarks

Z coordinate of the block.

Methods

  • Parameters

    • componentName: string

      Identifier of the component. If a namespace is not specified, minecraft: is assumed.

    Returns undefined | BlockComponent

    Returns the component object if it is present on the particular block.

    Remarks

    Gets additional configuration properties (a component) for specific capabilities of particular blocks - for example, an inventory component of a chest block.

    Throws

    This function can throw errors.

  • Parameters

    • permutation: BlockPermutation

      Permutation that contains a set of property states for the Block.

    Returns void

    Remarks

    Sets the block in the dimension to the state of the permutation.

    This function can't be called in read-only mode.

    Throws

    This function can throw errors.