A ClipboardItem is a handle to an object which represents a set of blocks in a contained bounding area (most likely copied from the world)

Hierarchy

  • ClipboardItem

Constructors

Properties

isEmpty: boolean

Remarks

Return whether there is any block content in the item

Throws

This property can throw when used.

Methods

  • Returns void

    Remarks

    Clear the contents of the item

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

    Throws

    This function can throw errors.

  • Parameters

    • location: Vector3

      A world location to which the ClipboardItem may potentially be written (nothing is actually written as part of this operation)

    • Optional options: ClipboardWriteOptions

      An optional set of write parameters which govern how the ClipboardItem should be potentially applied to the world

      Optional

    Returns CompoundBlockVolume

    A @minecraft/server.CompoundBlockVolume which represents the occupied block volumes within the ClipboardItem as they would be written to the world with the specified ClipboardWriteOptions

    Remarks

    Create a @minecraft/server.CompoundBlockVolume container which represents the occupied block volumes within the ClipboardItem. This function does not perform any write operations, and instead returns only a prediction of the volume area which would be affected as part of a write operation with a given set of write options.

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

    Throws

    This function can throw errors.

  • Parameters

    • location: Vector3

      A world location to which the ClipboardItem may potentially be written (nothing is actually written as part of this operation)

    • Optional options: ClipboardWriteOptions

      An optional set of write parameters which govern how the ClipboardItem should be potentially applied to the world

      Optional

    Returns Selection

    A Selection which represents the occupied block volumes within the ClipboardItem as they would be written to the world with the specified ClipboardWriteOptions

    Remarks

    Create a Selection container which represents the occupied block volumes within the ClipboardItem. This function does not perform any write operations, and instead returns only a prediction of the volume area which would be affected as part of a write operation with a given set of write options.

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

    Throws

    This function can throw errors.

  • Returns Vector3

    Remarks

    Get the bounding size of the ClipboardItem

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

    Throws

    This function can throw errors.

  • Parameters

    • selection: Selection

      A volume which represents the area to be copied

    Returns void

    Remarks

    Copy the contents of the area represented by a Selection volume into the ClipboardItem

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

    Throws

    This function can throw errors.

  • Parameters

    Returns void

    Remarks

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

    Throws

    This function can throw errors.

    Error

  • Parameters

    • from: Vector3

      The world location of one corner of a bounding volume

    • to: Vector3

      The world location of the opposite corner of a bounding volume

    Returns void

    Remarks

    Copy the contents of a rectangular volume into the Clipboard Item

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

    Throws

    This function can throw errors.

  • Parameters

    • location: Vector3

      The root point of the world location to which the ClipboardItem is written (this is modified by the various anchor, offset and rotation parameters of the ClipboardWriteOptions

    • Optional options: ClipboardWriteOptions

      An optional set of write parameters which modify the properties of the ClipboardItem as it is applied to the world

      Optional

    Returns boolean

    Success or Failure

    Remarks

    Apply the contents of a ClipboardItem to the world at a given location using a set of write options

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

    Throws

    This function can throw errors.