20% offevery plan

Black Friday Sale. New purchases, extensions and upgrades all qualify.

Ends in
00days
00hrs
00min
00sec
See plans
Everyday Tools

Macro steps: inventory, menus and dialogs

Click the right slots, wait for menus, move items in bulk, enchant, and answer server dialogs and Bedrock forms.

How slots are numbered

What is openNumbers
Nothing (the player inventory)0 to 8 crafting and armour (armour is 5 to 8), 9 to 35 the main inventory, 36 to 44 the hotbar, 45 the off hand on Java.
A menu or containerThe menu’s own slots first, from 0, then your main inventory, then your hotbar. A single chest has 27 slots, a large chest 54.

You rarely have to count. Every slot field has a Live example under it: pick a connected account and it draws the menu that account has open, with the numbers. Click a cell to fill the field in. Have the account open the menu first, in Chat or Point of View.

Open a menu and click through it

  1. Open it

    Type Command with the command that opens the menu, like /shop.

  2. Wait for it

    Wait for Window continues as soon as a menu opens. Better than a fixed delay on a laggy server.

  3. Click a slot

    Click GUI Slot with the slot number and the mouse button. Click N times repeats it, up to 200 times.

  4. Wait for the result

    Wait for Slot waits until a slot holds an item, when a menu fills in after a moment.

  5. Close it

    Close Window presses Escape.

Read Slot stores what a slot holds in a variable, so an If step can check a price or a name.

Move and drop items

StepWhat it does
Shift-Click All MatchingShift clicks every slot in a range that holds the item you name. With a shop menu open, that sells everything matching. The default range 9 to 44 skips armour.
Swap SlotsSwaps two slots.
Drop ItemDrops one item or the whole stack from a slot.
Drop Held ItemDrops what the account holds, one item or the stack.
Drop All ItemsEmpties the inventory, or drops only one item type. Armour is optional.
Find SlotFinds an item by name and stores its slot number, name and count in a variable.

Enchanting table

Enchant Item does what a player does at an enchanting table, on a Java account: it opens the table, puts in the item and the lapis, takes the offer you chose and puts the result back. Stand within about four blocks of the table.

SettingWhat it does
What to enchantBooks, items by name (* matches anything, like *_pickaxe), the item in one slot, or any enchantable item. Items that are already enchanted are never used.
Offer to takeThe highest the account can afford, the cheapest, or the top, middle or bottom offer.
How many itemsUp to 1000. 0 keeps going until items, lapis or levels run out.
Save the result to a variablecount, reason, item, enchantments, levels and offer.

The step fails when there is no table in reach, the inventory is full, or the first offer is not affordable.

Villager trading

Villager Trade trades with a villager or wandering trader on a Java account (1.14 or newer): it right-clicks the one under the crosshair or the nearest one within 3 blocks, picks the trade that gives the item you chose, pays from the inventory and puts what it bought into the inventory. When that villager does not sell the item, it tries the next one within reach. Walk there first with a Goto step.

SettingWhat it does
Item you want from the villagerThe item the trade gives you, like bread or enchanted_book. Pick emerald to sell items to the villager.
Enchantments the book must haveShown for enchanted_book only, like mending or sharpness 5. Leave it empty for any book.
How many tradesUp to 1000. 0 trades as many times as the villager's stock, your payment and your inventory space allow.
Save the result to a variablecount, items, reason and item.

Villagers lock a trade after it is used a number of times, often 12 or 16, until they restock. The step fails when no villager in reach sells the item, the trade is out of stock, the account cannot pay or the inventory is full before the first trade.

Server dialogs and Bedrock forms

Newer servers, DonutSMP included, open dialogs instead of chest menus: a screen with text, inputs and buttons. Buttons are numbered 1, 2, 3 in reading order, with the bottom row last. Inputs are numbered from the top. The Live example shows the numbers. Java needs 1.21.6 or newer, and Bedrock forms work with the same steps.

StepWhat it does
Wait for DialogWaits until a dialog opens, optionally one whose title contains your text.
Dialog InputFills an input, found by number, label or key: text, a toggle, an option or a slider.
Dialog ButtonPresses a button, found by number or label.
Close DialogPresses Escape on the dialog.

On a Bedrock form with inputs, fill them with Dialog Input and press button 1 to submit.

Example: sell through a shop menu

  1. Open the shop

    Type Command /shop, then Wait for Window.

  2. Go to the item

    Click GUI Slot for the category, then for the item.

  3. Sell

    Shift-Click All Matching with the item name, slots 9 to 44.

  4. Close and repeat

    Close Window, then turn on Forever with a few seconds Between Loops.

Need a hand?

Check the troubleshooting guide or return to all guides.