Inventory actions
Equip, eat, drink potions, drop, craft, and drive chests and server menus.
Seventeen actions covering the client's own inventory and any window it opens: a chest, a furnace, or a plugin shop GUI.
Two rules run through this whole page.
Every block that names an item has a dropdown next to it deciding how the name is matched:
| Dropdown | Matches | Field value |
|---|---|---|
| by name (default) | The registry id, e.g. diamond_sword | name |
| by display name | A custom, anvil-renamed name | display_name |
| by lore | Text inside the item's lore lines | lore |
A registry name matches exactly when such an item exists: stone is stone and never
cobblestone, stick is never a sticky piston, diamond is never a diamond sword. Text that
is not a registry name matches every item whose name contains it, so sword takes any sword
and _log any log. Blocks and mobs are matched the same way, in
dig nearest, attack
and the other blocks that name one. Player names always match exactly. Display name and lore
match any text they contain.
And every container block except open container needs a window already open. Without one they fail. A failure is visible to try and to the last_action_failed condition, which is how you check instead of guessing.
equip
Puts an item into a hand or an armour slot.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–64 chars | yes | What to equip. |
matchBy | name | display_name | lore | no | Default name. |
to | hand | off-hand | head | torso | legs | feet | no | Default hand. |
Fails when no item matches, or when the item cannot be worn in that armour slot (a sword
on head). When several items match, it takes one that fits the slot.
eat
Eats food and puts the previously held item back.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–64 chars | no | Eat this food. Leave out to pick the best safe food in the inventory. |
matchBy | name | display_name | lore | no | Default name. |
Best safe food is the one that restores the most hunger. It never picks rotten flesh,
spider eyes, poisonous potatoes, pufferfish, chorus fruit or suspicious stew unless you
name it in item. Fails when no matching food is in the inventory. When the client is
full, the step is done and counts as a success, except for golden apples, which can always
be eaten. So eat after a heal is safe: it tops food up and otherwise does nothing.
use_potion
Drinks a potion, or throws a splash potion at its own feet.
| Field | Type | Required | Notes |
|---|---|---|---|
effect | healing | regeneration | strength | swiftness | fire_resistance | no | Default healing. Strong and long variants count. |
A drinkable potion is preferred, and the step waits until it is drunk, so several
use_potion steps in a row each drink one. If there is only a splash potion, the client turns
to look straight down, throws it at its feet and looks level again. Lingering potions are
ignored. The previously held item goes back in the hand, in the hotbar slot it came from.
Fails when no matching potion is in the inventory, or when the drink did not happen. It works the
same on every supported game version, old potion data included.
equip_best
Puts the best weapon in hand and the best armour on.
| Field | Type | Required | Notes |
|---|---|---|---|
what | weapon | armor | both | no | Default both. |
A weapon is ranked by material, netherite then diamond then iron, then stone and gold
together, then wood, with a sword ahead of an axe at the same tier and a trident after a
diamond sword. Armour is ranked per slot, netherite, diamond, iron, chainmail, gold,
leather. A turtle shell counts as iron for the head, and an elytra in the chest slot is
left alone. Enchantments are ignored. When nothing beats what is worn, the step succeeds and
changes nothing. This is its own action rather than a special item name on
equip, so that action keeps meaning one item.
A good use is the item_collected
trigger, to put on a better sword a mob just dropped. Do not do that in a fishing flow:
see fish.
drop
Throws some of one item on the ground.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | yes | What to drop. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
count | integer, 1–64 | no | Omitted drops the whole stack. |
toPlayer | player name | no | Faces that player first, so the items land near them. |
The editor has one Drop block covering both this and
drop_all; which one it writes depends on
whether you asked for everything.
drop_all
Throws away every matching stack, or the entire inventory.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | no | Omitted drops everything the client carries. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
select_slot
Selects a hotbar slot.
| Field | Type | Required | Notes |
|---|---|---|---|
slot | integer, 0–8 | yes | Hotbar index, left to right. |
A variable that holds anything else fails the step; the rest of the trigger still runs.
craft
Crafts an item by registry name.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–64 chars | yes | What to craft. |
count | integer, 1–64 | no | Default 1. How many times to craft, not how many items: stick x 4 makes 16 sticks. |
The crafts run one at a time. When the materials run out part way, the crafts already made are kept and the step fails.
Recipes needing a 3×3 grid use a crafting table within 16 blocks, and the client walks to it first. Without one, only 2×2 recipes work. Planks of different woods mix in one recipe, the way they do for a player. To have the client work out a whole recipe chain from the base chests, use obtain.
container_open
Opens a container and holds the window for the actions that follow.
| Field | Type | Required | Notes |
|---|---|---|---|
mode | looking | coords | nearest | no | Omitted keeps the original rule: coordinates if given, otherwise the block being looked at. |
x, y, z | integers | for coords | Which block to open. |
radius | integer, 1–32 | no | Default 6. Search radius for nearest. |
mode: nearest is usually what you want for a client parked beside a chest whose exact
coordinates you do not know. It prefers a chest, barrel, shulker box, hopper, dispenser or
dropper over a closer furnace, smoker, blast furnace or brewing stand, and opens one of
those only when no storage container is in range.
Chests of every kind (copper chests included), barrels, shulker boxes, hoppers, dispensers, droppers, furnaces, smokers, blast furnaces and brewing stands all open as a window that the container actions below work on. The container must be within reach, 4.5 blocks, like a player; the step fails at once when it is further, or when the block is not a container.
menu_wait
Blocks until a server menu window opens, and latches it for the clicks that follow.
| Field | Type | Required | Notes |
|---|---|---|---|
timeoutMs | integer, 250–30000 | no | Default 3000. |
A menu that is already open counts, so the step returns at once. After a click in the menu it
waits for the next window replacing the current one (a buy screen followed by a confirm
screen), so a multi-step menu can be walked one menu_wait at a time. The step fails when no
menu opens before the timeout.
container_click
Clicks a raw slot in the open window, by index.
| Field | Type | Required | Notes |
|---|---|---|---|
slot | integer, 0–255 | yes | Slot index, numbered as the game numbers them: the container's own slots first, then the player inventory section. |
button | left | right | no | Default left. |
mode | normal | shift | no | Default normal. shift is a shift-click. |
Slot indexes break when a server rearranges its GUI. Prefer
menu_click, which finds the item
instead of trusting a position.
menu_click
Clicks the first slot in the open window whose item matches, wherever it sits.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–64 chars | yes | What to look for. |
matchBy | name | display_name | lore | no | Default name. |
button | left | right | no | Default left. |
Plugin shops label their buttons with display names and lore, so display_name and
lore matching is what makes a shop flow survive a layout change.
container_withdraw
Moves items out of the open container and into the inventory.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | yes | What to take. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
count | integer, 1–2304 | no | Omitted takes everything matching. |
container_deposit
Moves items from the inventory into the open container.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | yes | What to put in. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
count | integer, 1–2304 | no | Omitted deposits everything matching. |
container_deposit_all
Empties the inventory into the open container: every matching stack, or all of it.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | no | Omitted deposits the whole inventory. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
A blank item with all of it ticked means the whole inventory; typing a list deposits several materials in one step:
The "empty me into this chest" step of every farm loop.
container_withdraw_all
Pulls the open container empty: every matching stack, or everything in it.
| Field | Type | Required | Notes |
|---|---|---|---|
item | string, 1–200 chars | no | Omitted takes everything. Several, separated by commas or semicolons, match any of them (name matching only). |
matchBy | name | display_name | lore | no | Default name. |
container_close
Closes the open window.
No fields.
Close what you open. A window left open blocks the next container_open, and
window_closed is how another trigger
learns it went away.