类 Structure实验性

Represents a loaded structure template (.mcstructure file). Structures can be placed in a world using the /structure command or the StructureManager APIs.

属性

id: string

The name of the structure. The identifier must include a namespace. For structures created via the /structure command or structure blocks, this namespace defaults to "mystructure".

size: Vector3

The dimensions of the structure. For example, a single block structure will have a size of {x:1, y:1, z:1}

This property can throw when used.

InvalidStructureError

方法

  • 实验性

    参数

    • location: Vector3

      The block location relative to the Structure's origin.

    返回 boolean

    Returns whether the block at the given location is waterlogged. Returns false if a block does not exist at the given location.

    Returns whether the block at the given location is waterlogged.

    Throws if the location is outside the structure's bounds. Throws if the Structure has been deleted.

    minecraftcommon.InvalidArgumentError

    InvalidStructureError

  • 实验性

    返回 boolean

    Returns whether the Structure is valid.

    Returns whether the Structure is valid. The Structure may become invalid if it is deleted.

  • 实验性

    参数

    • location: Vector3

      The block location relative to the Structure's origin.

    • 可选blockPermutation: BlockPermutation

      The BlockPermutation to set.

    返回 void

    Sets a BlockPermutation within a Structure.

    无法在只读模式下调用此函数,详见 WorldBeforeEvents

    Throws if the type of block is StructureVoid. Throws if the block is undefined and waterlogged is set to true. Throws if the block is air and waterlogged is set to true. Throws if the location is outside the structure's bounds. Throws if the Structure has been deleted.

    minecraftcommon.InvalidArgumentError

    InvalidStructureError