20% offevery plan

Spooky Sale. Happy Halloween! New purchases, extensions and upgrades all qualify.

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

Macro steps: inventory, menus and dialogs

Click slots with the right numbers, wait for menus, move items in bulk, enchant at an enchanting table, and answer server dialogs and Bedrock forms.

How slots are numbered

Every slot step uses the numbering of the window that is open at that moment.

WindowNumbers
Nothing open (player inventory)0 to 8 are the crafting grid and armour (armour is 5 to 8), 9 to 35 the main inventory, 36 to 44 the hotbar, and 45 the off hand on Java.
A menu or container is openThe menu’s own slots come first, 0 up to its size minus one, then your main inventory, then your hotbar. A single chest has 27 menu slots, a large chest 54.

Every slot field in the builder has a Live example panel under it. Pick one of your connected accounts and the panel draws the menu that account has open, or its player inventory when nothing is open, with the exact numbers. Click a cell to write that number into the field. Nothing is sent to the account; the panel only reads. Set Hotbar shows a hotbar bar the same way, numbered 0 to 8.

Open a menu and click through it

  1. Open it

    Add Type Command with the command that opens the menu, such as /shop.

  2. Wait for it

    Add Wait for Window. It continues as soon as a container opens, or gives up after the timeout (500 to 120,000 ms). This beats a fixed wait on a laggy server.

  3. Click a slot

    Add Click GUI Slot with the slot number, the mouse button, and Shift Click when the menu expects it. Click N times (1 to 200) with a Delay between clicks repeats the same click, for example to buy a stack several times.

  4. Wait for the result

    Where a menu fills a slot after a moment, add Wait for Slot: the slot number, an optional item name, a minimum count, a timeout (100 to 300,000 ms), and what to do on timeout. It polls the open menu until the slot holds what you asked for.

  5. Close it

    Add Close Window, which presses Escape.

Read Slot stores what a slot holds into a variable so a later If step can check the price or the name; see variables, conditions and loops.

Move and drop items in bulk

StepSettings
Shift-Click All MatchingShift-clicks every slot in a range whose item matches the name, with a delay between clicks (20 to 2000 ms). With a shop or deliver menu open, this dumps everything matching into it. The default range 9 to 44 skips armour.
Swap SlotsSwaps the contents of two slots.
Drop ItemDrops one item, or the whole stack, from a slot.
Drop Held ItemDrops what the selected hotbar slot holds: the whole stack, like Ctrl+Q, or a single item like Q.
Drop All ItemsEmpties the inventory with a delay between drops, optionally including armour, or limited to one item id.
Find SlotSearches for an item by name inside a slot range, preferring the hotbar, and stores the slot number, whether it was found, the name, and the count in a variable. Tick the container option to search the open menu instead of the player inventory.

Enchanting table

Enchant Item does everything a player does at an enchanting table: it opens the table, puts the item into the item slot and lapis lazuli into the lapis slot from anywhere in the inventory, waits for the three offers, takes the one you chose, puts the enchanted item back into the inventory and closes the table. It works on Java accounts. Stand within reach of the table first (about four blocks); add a Goto Coords step before it if the account has to walk there. The table under the crosshair is used first, otherwise the nearest one.

SettingWhat it does
What to enchantBooks, An item by name (one or more names separated by commas, * matches anything, for example diamond_sword, *_pickaxe), The item in an inventory slot (9 to 35 main inventory, 36 to 44 hotbar), or Any enchantable item (swords, axes, tools, armour, bows, crossbows, tridents, maces, fishing rods and books). Items that already have enchantments are never used.
Offer to takeHighest level the account can afford (the default), Cheapest offer, or exactly the top, middle or bottom offer. Like in the game the top, middle and bottom offers cost 1, 2 and 3 lapis lazuli and as many levels, and the account needs at least the level shown on the offer.
How many itemsHow many items to enchant in this step, up to 1000. 0 keeps going until the items, the lapis or the levels run out.
Delay between clicksThe pause between clicks in the table, 50 to 5000 ms, with a little random variation (default 250 ms).
Save the result to a variableOptional. The variable holds count, reason (done, no-items, no-lapis, no-levels), item, enchantments, levels and offer, so a Discord Alert can say %var:ench.count% books enchanted.

Server dialogs and Bedrock forms

Newer servers, DonutSMP included, open dialogs instead of chest menus: a titled screen with text, inputs such as a text box, an on/off toggle, an option cycler or a slider, and buttons. Buttons are numbered 1, 2, 3 in reading order, top left first, with the Back, OK, Yes and No buttons at the bottom counted last. Inputs are numbered 1, 2, 3 from the top. The Live example under these steps shows the numbers on the dialog the account has open.

Java servers send dialogs from 1.21.6 on. Bedrock forms work with the same steps, on Geyser servers such as DonutSMP and on Bedrock servers. A button menu numbers its buttons 1, 2, 3 from the top. A yes or no question has button 1 for the first answer and 2 for the second. A form with inputs numbers them from the top and has one Submit button, number 1: fill the inputs with Dialog Input, then press button 1.

StepSettings
Wait for DialogWaits until a dialog opens, optionally one whose title contains your text, up to the timeout (500 to 120,000 ms).
Dialog InputFills an input found by number, by its label text, or by the key the plugin gave it. Text box: any text, tokens allowed. Toggle: on or off. Option cycler or dropdown: the option id or the text it shows. Slider: a number.
Dialog ButtonPresses a button found by number or by label text, and runs what the button does: a command, a custom action with the current input values, or the next dialog.
Close DialogPresses Escape on the open dialog.

The If, Wait Until Condition, and Switch steps can test whether a dialog is open and read its title or body text. Java accounts on versions older than 1.21.6 skip dialog steps with a console line.

Example: sell through a shop menu

A typical sell loop, with slot numbers you replace with your server’s:

  1. Open the shop

    Type Command /shop, then Wait for Window 5000.

  2. Navigate

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

  3. Sell

    Shift-Click All Matching with the item name, slots 9 to 44, so every stack moves into the menu.

  4. Close and repeat

    Close Window, then set Forever on with a few seconds Between loops.

Need a hand?

Check the troubleshooting guide or return to all guides.