类 ClipboardItem实验性

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)

属性

id: string
isEmpty: boolean

Return whether there is any block content in the item

This property can throw when used.

方法

  • 实验性

    参数

    • location: Vector3

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

    • 可选options: ClipboardWriteOptions

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

    返回 CompoundBlockVolume

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

    Create a minecraftserver.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.

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

    This function can throw errors.

  • 实验性

    参数

    • location: Vector3

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

    • 可选options: ClipboardWriteOptions

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

    返回 Selection

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

    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.

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

    This function can throw errors.

  • 实验性

    参数

    • selection: Selection

      A volume which represents the area to be copied

    返回 void

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

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

    This function can throw errors.

  • 实验性

    参数

    • 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

    返回 void

    Copy the contents of a rectangular volume into the Clipboard Item

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

    This function can throw errors.

  • 实验性

    参数

    • 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

    • 可选options: ClipboardWriteOptions

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

    返回 boolean

    Success or Failure

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

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

    This function can throw errors.