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 open | Numbers |
|---|---|
| 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 container | The 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
Open it
Type Command with the command that opens the menu, like
/shop.Wait for it
Wait for Window continues as soon as a menu opens. Better than a fixed delay on a laggy server.
Click a slot
Click GUI Slot with the slot number and the mouse button. Click N times repeats it, up to 200 times.
Wait for the result
Wait for Slot waits until a slot holds an item, when a menu fills in after a moment.
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
| Step | What it does |
|---|---|
| Shift-Click All Matching | Shift 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 Slots | Swaps two slots. |
| Drop Item | Drops one item or the whole stack from a slot. |
| Drop Held Item | Drops what the account holds, one item or the stack. |
| Drop All Items | Empties the inventory, or drops only one item type. Armour is optional. |
| Find Slot | Finds 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.
| Setting | What it does |
|---|---|
| What to enchant | Books, 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 take | The highest the account can afford, the cheapest, or the top, middle or bottom offer. |
| How many items | Up to 1000. 0 keeps going until items, lapis or levels run out. |
| Save the result to a variable | count, 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.
| Setting | What it does |
|---|---|
| Item you want from the villager | The item the trade gives you, like bread or enchanted_book. Pick emerald to sell items to the villager. |
| Enchantments the book must have | Shown for enchanted_book only, like mending or sharpness 5. Leave it empty for any book. |
| How many trades | Up to 1000. 0 trades as many times as the villager's stock, your payment and your inventory space allow. |
| Save the result to a variable | count, 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.
| Step | What it does |
|---|---|
| Wait for Dialog | Waits until a dialog opens, optionally one whose title contains your text. |
| Dialog Input | Fills an input, found by number, label or key: text, a toggle, an option or a slider. |
| Dialog Button | Presses a button, found by number or label. |
| Close Dialog | Presses 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
Open the shop
Type Command
/shop, then Wait for Window.Go to the item
Click GUI Slot for the category, then for the item.
Sell
Shift-Click All Matching with the item name, slots 9 to 44.
Close and repeat
Close Window, then turn on Forever with a few seconds Between Loops.
Check the troubleshooting guide or return to all guides.