Skip to content

Copy Operation

Data Type

An object that determines how NBT is copied from the specified source NBT path to the target NBT path.

Fields

Field Type Default Description
source NBT Path The NBT path to copy from.
target NBT Path The NBT path to copy to.
op String Determines how the NBT is copied. Accepts either "replace", "merge" (for merging objects) or "append" (for adding to the end of an array).

Examples

"ops": [
    {
        "source": "Item.tag.gems",
        "target": "collectedGems",
        "op": "replace"
    }
]

This example will completely replace the contents of the collectedGems NBT path with the data from the Item.tag.gems NBT path.

"ops": [
    {
        "source": "Item.tag",
        "target": "tag",
        "op": "merge"
    }
]

This example will merge the contents of the Item.tag NBT path to the tag NBT path, meaning that new NBTs will be added and NBTs that exist in both the target and source paths are replaced by the NBT from the source.