Store Data (Entity Action Type)

Writes the entity's id, position and NBT into a command storage so commands and function macros can read it back.

Writes the entity’s id, position and NBT into a command storage, where /data get storage, a function macro, or apoli:execute_command’s own arguments can read it back.

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, e.g. "grabbed" or "last.hit". Empty writes at the root.
nbtBooleantrueWhether to include the entity’s full NBT under nbt. Serialising an entity is not cheap — turn it off in anything that runs every tick.
mergeBooleanfalseMerge into whatever is already at path instead of replacing it.

What gets written

KeyTypeValue
idStringThe entity type id, e.g. minecraft:zombie.
uuidStringThe entity’s UUID.
nameStringThe entity’s display name.
x, y, zDoubleThe entity’s position.
posString"x y z", ready to paste into a command.
dimensionStringThe dimension the entity is in.
nbtCompoundThe entity’s NBT, when nbt is true.

Examples

"entity_action": {
  "type": "apoli:store_data",
  "storage": "example:scratch",
  "path": "victim",
  "nbt": false
}

Then read it back straight away, without needing function macros at all:

"entity_action": {
  "type": "apoli:execute_command",
  "command": "summon minecraft:lightning_bolt $(pos)",
  "arguments": {
    "storage": "example:scratch",
    "path": "victim"
  }
}