Store Data (Item Action Type)

Writes the item's id, count and NBT into a command storage.

Writes the item stack’s id, count and NBT into a command storage, so a later command or function macro can rebuild it.

Type ID: apoli:store_data

Fields

FieldTypeDefaultDescription
storageIdentifierThe command storage to write into, e.g. example:scratch.
pathString""A dot-separated key path inside that storage. Empty writes at the root.
nbtBooleantrueWhether to include the stack’s saved NBT under nbt.
mergeBooleanfalseMerge into whatever is already at path instead of replacing it.

What gets written

KeyTypeValue
idStringThe item id, e.g. minecraft:diamond_sword.
countIntThe stack size.
nameStringThe stack’s display name.
nbtCompoundThe stack’s saved NBT, when nbt is true. On 1.21 that is the component form; on 1.20.1 it is the tag form.

Examples

"item_action": {
  "type": "apoli:store_data",
  "storage": "example:scratch",
  "path": "held"
}
"entity_action": {
  "type": "apoli:execute_command",
  "command": "give @s $(id)",
  "arguments": {
    "storage": "example:scratch",
    "path": "held"
  }
}