Change Slot (Entity Action Type)
Swaps or moves the contents of two slots.
Swaps or moves the contents of two slots.
Type ID: apoli:change_slot
Fields
| Field | Type | Default | Purpose |
|---|---|---|---|
slot_a | Item Slot | required | The first slot. |
slot_b | Item Slot | required | The second slot. |
operation | String | "swap" | "swap" exchanges the two stacks; "move" puts slot_a’s stack into slot_b and empties slot_a. |
inventory_type | Inventory Type | "inventory" | Whether the slots refer to the entity’s inventory or to an apoli:inventory power’s container. |
power | Identifier | optional | The apoli:inventory power to act on. Required when inventory_type is "power". |
"move"discards whatever was inslot_b. Use"swap"unless deleting it is the point.
With inventory_type: "inventory" the slot ids are the same ones the /item command uses, so armor.head, weapon.offhand and enderchest.4 all work — on any entity that has those slots, not just players. A slot that refuses the stack (armor slots reject non-armor) leaves both slots untouched rather than dropping the item.
With inventory_type: "power" the slots are indices into that power’s own container, container.0 upward.
Examples
{
"type": "apoli:change_slot",
"slot_a": "weapon.mainhand",
"slot_b": "weapon.offhand"
} Swaps the held item with the off-hand item.
{
"type": "apoli:change_slot",
"slot_a": "weapon.mainhand",
"slot_b": "container.0",
"operation": "move",
"inventory_type": "power",
"power": "example:pocket_dimension"
} Stores whatever is held into the first slot of a power inventory, emptying the hand.