Villager trading
Bots trade with villagers and wandering traders the way a player does. A right click on the villager opens its trading window, with its trades listed down the left. Pick one, and the server moves the price out of the bot's inventory into the payment slots, and what the trade sells appears in the result slot for the bot to take.
There are three places to trade from:
- The POV, in the game's own trading screen. You right-click the villager and pick the trade yourself.
- The Inventory page, which lists the trades in a window the bot already has open.
- The Trade step in a macro, which names the item you want rather than a trade, so one step works on any villager that sells it.
What you need
On Java Edition, trades need Minecraft 1.14 or newer. On older versions a villager's trading window still opens, with its payment and result slots, but no trades in it, and a macro's Trade step is skipped. Where the list would be, the Inventory page says "Trades show on Minecraft 1.14 and newer." Bedrock accounts skip the Trade step too. Which Minecraft versions are supported? lists the other features that depend on the version.
Your plan decides where you can trade from:
| Where | Plans |
|---|---|
| The POV | Every plan |
| The Inventory page | Tier 3 |
| A macro's Trade step | Every plan |
On other plans the Inventory page still shows the trades, greyed out, with the note "Inventory management requires Tier 3." Plans and limits has the full list.
Trade in the POV
- Visit minecraftafk.com/dashboard/servers/.
- Click the server profile you wish to use.
- Click the POV page.
- Open the bot fullscreen, with the fullscreen button on its card.
- With the bot standing next to the villager or wandering trader, aim at it and right-click (see Clicking). Its trading screen opens over the view.
- Click the trade you want in the list on the left. Its price moves from the bot's inventory into the payment slots, and what it sells appears in the result slot.
- Take it from the result slot as you would any item: click to pick it up, or Shift-click to move it straight into the inventory.
E or Esc closes the trading screen, on the server as well as on your screen.
The list shows seven trades at a time, as in game. Scroll it with the mouse wheel, or drag the scroll bar beside it. If the bot can't pay the full price, nothing appears in the result slot.
On a phone or tablet, aim the crosshair at the villager and tap Use to open its window. Swipe the list to scroll it and tap a trade to pick it. Then tap the result slot for what you can do with it, such as Quick move, or hold it to quick-move it straight away.
A trading window a macro opens shows up read-only, so you can watch the macro trade without getting in its way. Press Take over to end its run and trade yourself: see While a macro is running.
What a trade shows
The POV and the Inventory page draw a trade the same way: what it costs, one item or two, then an arrow and what it sells. Hover an item for its tooltip.
- Prices that moved. A price that has moved with demand or reputation shows the base price struck through beside the real one.
- Sold out. The POV crosses out a sold-out trade's arrow, and the Inventory page fades the trade and marks it Out of stock. Nothing appears in the result slot for a sold-out trade until the villager restocks.
- The cross in the POV. When the selected trade is sold out, the POV also puts a large cross between the payment and result slots. On a villager, hovering the cross says "Villagers restock up to two times per day." A wandering trader never restocks, so its cross has no note and its sold-out trades stay sold out.
- Level. A villager's level runs from Novice through Apprentice, Journeyman and Expert to Master. The POV adds it to the trading screen's title, and the bar under the title fills as the villager earns experience towards its next level. With a trade's price in the payment slots, a lighter stretch of the bar shows how far that trade would take it. A Master has no bar. The Inventory page names the level beside Trades. A wandering trader has no level, so neither shows one.
Trade on the Inventory page
The Inventory page trades in a window the bot already has open, from the POV or a macro. It lists the trades beside the window's slots rather than drawing the game's screen.
- Visit minecraftafk.com/dashboard/servers/.
- Click the server profile you wish to use.
- Open its Inventory page.
- Pick the account in the dropdown at the top. Its trading window shows under Open Container: the Trades list, with the Payment and Result slots to its right (under it on a phone).
- Click a trade. The server moves its price from the bot's inventory into the payment slots, and the result appears in the result slot.
- Take the result like any other item: click it and place it in the inventory, or Shift + Click it to quick move it.
The list holds every trade, rather than seven at a time, and highlights the trade picked last, whoever picked it. The cross on the container's corner closes the window. On a phone or tablet, tap a trade to pick it, and tap the result slot for its actions, such as Quick move.
Picking a trade here needs Tier 3, like the rest of the page's controls.
Trade from a macro
The Trade step buys from the villager or wandering trader whose window is open. It names the item you want, not a place in the list, so one step works on any villager that sells that item: the bot picks the trade that gives it, pays from its own inventory and takes what it bought. Selling is trading too. A farmer pays emeralds for wheat, so a step that sells wheat is a step that gets emeralds.
The window has to be open first, the same way you would open it: turn the bot to the villager, then right click.
- Visit minecraftafk.com/dashboard/servers/.
- Click the server profile you wish to use, click the macros page, and open a macro.
- Add a Look at entity step with the plus button. Under Match pick By name, and type
villagerunder Name contains (orwandering_trader). - Add a Right click once step after it, to open the trading window.
- Add a Trade step after that. It's with the Inventory steps.
- Under Item to get, pick what the bot should end up with. Under Amount, pick One trade or As many as it can.
- End with a Close GUI step, which closes the window, and save the macro.
Look at entity turns the bot's head and doesn't move it, and a right click only reaches what's within arm's length, so the bot has to be standing by the villager. If it isn't parked there, put a Walk to step set to Nearest entity in front of the Look at entity: see Walk to in a macro.
The Close GUI matters because the bot sends no chat while a window is open, and the builder can't see a window that a right click opened, so it won't warn you about this one or add the step for you. See Use GUI.
The Trade step's panel holds four settings:
- Item to get is what the bot ends up with, picked from the game's item list. A new step starts on emeralds.
- Amount is One trade, or As many as it can, the default: the bot keeps trading until it runs out of what the trade costs, the villager sells out, or its inventory is full.
- Only the trade paid with a certain item is for a villager that sells the item more than one way. A farmer can pay emeralds for both wheat and potatoes, so a step that sells wheat ticks the box and picks wheat under Paid with. Paid with starts on emeralds, or empty when emeralds are the item to get, and the macro won't save while the box is ticked with nothing picked. Left unticked, any trade that gives the item will do.
- Wait for the window to open is ticked to begin with. If no villager window is open when the step starts, it waits up to 30 seconds for one, then the macro carries on. Unticked, the step is skipped at once.
Trade and the steps around it (Look at entity, Right click once, Walk to and Close GUI) are on every plan. A Join macro trades each time the bot joins. To trade on the clock, use a Timer or Schedule event, which needs Tier 3, or run the macro yourself with Run now.
When the Trade step is skipped
If the bot can't make the trade, the step is skipped and the macro carries on with the next step. The macro's log says why:
| Log | What happened |
|---|---|
| No such trade | The villager has no trade that gives the item, or none paid with the item under Paid with. |
| Out of stock | The trade is sold out. Villagers restock up to two times per day; a wandering trader never does. |
| Cannot afford | The bot doesn't carry enough to pay for it. |
| Inventory full | The bot has no room for what it would buy. |
| Cannot trade here | The account is on Bedrock, or the profile's Java version is older than 1.14. |
With no trading window open, the step waits as its Wait for the window to open box says, and the macro then carries on without trading.
To see what a villager sells, and for what, before you build the step, open its window in the POV.
Waypoints
Save the spots your bots keep going back to, like a farm or a spawner, and send them there by name from the POV, a macro or the Movement page.
Map, tracers and zoom
See what's around your Minecraft bot: a map from straight above with the players and mobs near it, a line to every other player, and a zoom for what's far off. The map is on the Movement page too.