@minecraft/server
    Preparing search index...

    Class StructureBeta

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

    Index

    Properties

    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".

    isValid: boolean

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

    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

    Methods

    • Beta

      Parameters

      • location: Vector3

        The block location relative to the Structure's origin.

      Returns undefined | BlockPermutation

      Returns a BlockPermutation. Returns undefined if a block does not exist at the given location.

      Returns a BlockPermutation representing the block contained within the Structure at the given location.

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

      minecraftcommon.InvalidArgumentError

      InvalidStructureError

    • Beta

      Parameters

      • location: Vector3

        The block location relative to the Structure's origin.

      Returns 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

    • Beta

      Parameters

      • identifier: string

        The name of the newly created Structure.

      • OptionalsaveMode: StructureSaveMode

        Determines how the Structure should be saved. Defaults to saving to the world.

      Returns Structure

      Returns the newly created structure.

      Creates a copy of a Structure and saves it with a new name.

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

      Throws if the identifier is invalid. A valid identifier must include a namespace and must be unique. Throws if the Structure has been deleted.

      minecraftcommon.EngineError

      minecraftcommon.InvalidArgumentError

      InvalidStructureError

    • Beta

      Returns void

      Saves a modified Structure to the world file.

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

      Throws if the Structure has been deleted.

      InvalidStructureError

    • Beta

      Parameters

      • location: Vector3

        The block location relative to the Structure's origin.

      • OptionalblockPermutation: BlockPermutation

        The BlockPermutation to set.

      • Optionalwaterlogged: boolean

        Specifies whether the block should be waterlogged. Air and undefined blocks cannot be waterlogged.

      Returns void

      Sets a BlockPermutation within a Structure.

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

      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