Class BlockLocation

Contains the integer X, Y, Z coordinates for a block. For decimal locations useful for entities, items, and more, see Location.

Hierarchy

  • BlockLocation

Constructors

Properties

x y z

Methods

Constructors

  • Parameters

    • x: number

      X position of the block location. This number should be an integer.

    • y: number

      Y position of the block location. This number should be an integer.

    • z: number

      Z position of the block location. This number should be an integer.

    Returns BlockLocation

    Remarks

    Creates a new instance of an abstract block location.

Properties

x: number

The X coordinate.

y: number

The integer-based Y position.

z: number

The integer-based Z position.

Methods

  • Returns BlockLocation

    Remarks

    Returns a BlockLocation for a block above this BlockLocation (that is, y + 1).

  • Parameters

    • other: BlockLocation

      Additional BlockLocation used to determine the set of locations in between this location and another point.

    Returns BlockLocation[]

    Array of block locations representing the volume between this location and another, inclusive of the start and end points.

    Remarks

    Returns an array of block locations representing all blocks in the volume (cuboid) between this location and another location.

  • Parameters

    • other: BlockLocation

      Other block location to compare this BlockLocation to.

    Returns boolean

    True if the two block locations are equal.

    Remarks

    Compares this BlockLocation and another BlockLocation to one another.

  • Parameters

    • x: number

      X offset relative to this BlockLocation.

    • y: number

      Y offset relative to this BlockLocation.

    • z: number

      Z offset relative to this BlockLocation.

    Returns BlockLocation

    BlockLocation that is positioned relative to this BlockLocation.

    Remarks

    Returns a block location using a position relative to this block location