Villager Trade Generator
BetaSet up a villager shop: pick the profession, level and biome look, add your trades and see them in a trading screen preview. The generator writes the /summon command in your version's item format.
Describe it — AI writes the command
Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.
Checking the AI…
Paste a command— edit it here or move it to another version
Enchanted BookMending I
12 uses before restock · +15 villager XP
Your command · Java 26.3
644 characters/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Xp:250,Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:24},buyB:{id:"minecraft:book",count:1},sell:{id:"minecraft:enchanted_book",count:1,components:{"minecraft:stored_enchantments":{"minecraft:mending":1}}},maxUses:12,xp:15},{buy:{id:"minecraft:paper",count:24},sell:{id:"minecraft:emerald",count:1},maxUses:16,xp:2},{buy:{id:"minecraft:emerald",count:9},sell:{id:"minecraft:bookshelf",count:1},maxUses:12,xp:5}]},CustomName:{text:"Book Shop",color:"gold"},CustomNameVisible:1b,NoAI:1b,Invulnerable:1b,PersistenceRequired:1b}
- Command is 644 characters — chat takes 256, so use a command block.
Raw editor
How it works
A villager’s trades live in its Offers tag: a list of recipes, each with a cost item (buy), an optional second cost (buyB), the item it sells (sell), how many times it can be used before the villager restocks (maxUses) and how much XP the villager gets (xp). Its job, level and biome look are in VillagerData, which arrived in 1.14 with Village & Pillage, so the generator writes Java 1.14 and later.
Java 1.14 to 1.20.4
summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Xp:250,Offers:{Recipes:[{buy:{id:"minecraft:emerald",Count:24b},sell:{id:"minecraft:enchanted_book",Count:1b,tag:{StoredEnchantments:[{id:"minecraft:mending",lvl:1s}]}},maxUses:12,xp:15}]}}Java 1.20.5 to 1.21.4
Item counts became count numbers and item data moved into components:
summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Xp:250,Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:24},sell:{id:"minecraft:enchanted_book",count:1,components:{"minecraft:stored_enchantments":{levels:{"minecraft:mending":1}}}},maxUses:12,xp:15}]}}Java 1.21.5 and later (26.x too)
Enchantments lost the levels wrapper, and a custom name is SNBT instead of a JSON string:
summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Xp:250,Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:24},sell:{id:"minecraft:enchanted_book",count:1,components:{"minecraft:stored_enchantments":{"minecraft:mending":1}}},maxUses:12,xp:15}]},CustomName:{text:"Book Shop"}}Bedrock
Bedrock’s /summon can’t set trades, levels or the biome look. It can give the villager a job, through the spawn events in the villager’s behaviour file. The game then rolls that profession’s normal trades:
summon villager_v2 ~ ~ ~ 0 0 minecraft:become_librarian "Book Shop"
Use villager_v2: plain villager on Bedrock is the old pre-1.11 villager. Worlds older than 1.19.70 leave out the two rotation numbers.
Keeping your trades
Every level-up adds the profession’s usual random trades to the list, so set level 5 (Master) if you want only yours. A level 1 villager that has never traded also loses its job, and its trades, when it has no job site block nearby. Level 2 or higher, or No AI, prevents that. Unemployed villagers and nitwits won’t trade at all.
FAQ
How do I give a villager custom trades?
Summon it with an Offers tag that lists your trades. Add the trades in the generator, pick your Java version and copy the /summon command into a command block: long trade lists go over the 256-character chat limit.
Why does my villager get extra trades I didn't add?
Trading gives the villager XP, and each level-up adds random trades from its profession. Summon it at level 5 (Master), which has no next level, and it keeps only your trades.
How do I sell an enchanted book with Mending?
Set the result to enchanted_book and add the enchantment. Before 1.20.5 the generator writes StoredEnchantments in the item's tag; from 1.20.5 it uses the stored_enchantments component.
Can I make custom villager trades on Bedrock?
Not with commands. Bedrock's /summon has no NBT, so trades come from the game's trade tables. You can set the profession with a spawn event such as minecraft:become_librarian. Fully custom trades need a behaviour pack.
How do I stop a trading villager from walking away?
Tick No AI. The villager stays exactly where it was summoned and doesn't turn to look at you, but you can still open its trades. Add Invulnerable so it can't be killed.
Does a summoned wandering trader despawn?
No. Wandering traders that spawn naturally leave after a while, but one made with /summon stays until it is killed.