Store Data (Block Action Type)

Writes the block's id, state string, position and block-entity NBT into a command storage.

Writes the block’s id, full state string, position and block-entity NBT into a command storage, so a later command can place it back, copy it, or hand it to a function macro.

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 block entity’s NBT under nbt, when the block has one.
mergeBooleanfalseMerge into whatever is already at path instead of replacing it.

What gets written

KeyTypeValue
idStringThe block id, e.g. minecraft:oak_log.
stateStringThe block id with its properties, e.g. minecraft:oak_log[axis=y] — exactly what /setblock wants.
propertiesCompoundEach block-state property as a string, e.g. {axis: "y"}.
x, y, zIntThe block position.
posString"x y z", ready to paste into a command.
dimensionStringThe dimension the block is in.
nbtCompoundThe block entity’s NBT, when there is one and nbt is true.

Examples

Store the block a power just interacted with, then place a copy of it in front of the player:

"block_action": {
  "type": "apoli:store_data",
  "storage": "example:scratch",
  "path": "block"
}
"entity_action": {
  "type": "apoli:execute_command",
  "command": "setblock ^ ^ ^2 $(state)",
  "arguments": {
    "storage": "example:scratch",
    "path": "block"
  }
}

$(state) carries the block’s properties with it, so a log placed this way keeps its axis. arguments is apoli:execute_command’s own macro substitution, so this works on every version — no function macros required. If you would rather use a real function macro, the same storage is readable with /function example:place with storage example:scratch block.