Open Villager Trades
minecraft_open_villagerLocate and open a villager's trade menu, see available trades, and execute trades using entity ID or nearest selection.
Instructions
Walks to and opens trade with a villager (by entity id from minecraft_get_nearby_entities, or the nearest one), and lists its available trades. Stays open until minecraft_close_container is called — use minecraft_trade to execute a trade.
Returns: { message, trades: [{ index, give: string[], receive: string, usesLeft, disabled }] } Errors: no villager nearby/found.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| entity_id | No | Entity id from minecraft_get_nearby_entities. Omit for nearest villager. |