A class for working with block clipboards.

Type Parameters

  • ClipboardID extends string = string

    The ID of this block clipboard.

Constructors

Properties

clipboardID: ClipboardID

The ID of this block clipboard.

global: typeof Globals.modules.coords.GlobalBlockClipboard = GlobalBlockClipboard

The global block clipboard.

Accessors

  • get contentsSize(): Vector3

    The size of the contents of this block clipboard.

    When the block clipboard is empty, this will be { x: -1, y: -1, z: -1 }.

    Returns Vector3

    { x: -1, y: -1, z: -1 }
    
  • get contentsSizeLimits(): Vector3

    The sizes of the chunks of the contents of this block clipboard.

    When the block clipboard is empty, this will be { x: 64, y: 128, z: 64 }.

    Returns Vector3

    { x: 64, y: 128, z: 64 }
    
  • get ids(): `clipboard:${ClipboardID},${number},${number},${number}`[]

    The structure IDs of the contents of this block clipboard.

    Returns `clipboard:${ClipboardID},${number},${number},${number}`[]

  • get isEmpty(): boolean

    Whether this block clipboard is empty.

    Returns boolean

Methods

  • Clears the contents of this block clipboard.

    Returns void

  • Copies the specified area to this block clipboard.

    Parameters

    • dimension: Dimension

      The dimension of the area to copy to the clipboard.

    • area: { from: Vector3; to: Vector3 }

      The area to copy to the clipboard.

    • Optionaloptions: StructureCreateOptions

      The options to copy the area to the clipboard with.

    • OptionalsizeLimits: Vector3 = ...

      The sizes of the chunks of the clipboard. Defaults to { x: 64, y: 128, z: 64 }.

    Returns void

  • Deletes the block clipboard.

    Returns void

  • Gets the structure at the specified indices in the clipboard contents.

    Parameters

    • indices: Vector3

      The indices to get the structure for.

    Returns undefined | Structure

    The structure at the specified indices in the clipboard contents, or undefined if no structure is found at the specified indices.

  • Gets the structure that contains the specified position in the clipboard contents.

    Parameters

    • position: Vector3

      The position to get the structure for.

    Returns undefined | Structure

    The structure that contains the specified position in the clipboard contents, or undefined if no structure is found containing the specified position.

  • Pastes the contents of this block clipboard asynchronously.

    Parameters

    Returns Promise<void>

    A promise that resolves when the contents of the clipboard have been pasted.

    If the clipboard is empty.

  • Clears the contents of all block clipboards.

    Returns void

  • Deletes all block clipboards.

    Returns void

  • Deletes a block clipboard by its ID.

    Parameters

    • clipboardID: string

      The ID of the block clipboard.

    Returns void

    If the block clipboard ID contains a comma.

    If the block clipboard ID is global.

  • Gets all block clipboard IDs.

    Returns string[]

    An array of all of the block clipboard IDs.

  • Gets block clipboards by their IDs.

    Type Parameters

    • ClipboardIDs extends string[]

      The IDs of the block clipboards to get.

    Parameters

    • clipboardIDs: ClipboardIDs

      The IDs of the block clipboards to get.

    Returns {
        [K in string | number | symbol]: Globals.modules.coords.BlockClipboard<
            ClipboardIDs[K<K>],
        >
    }

    An array of the block clipboards with the specified IDs.

    If any of the block clipboard IDs contain a comma.

    If any of the block clipboard IDs are global.