Villager
Who is trading, and at which level
Trades
Up to 24, in the order the villager lists them
Loading items…
Command
Paste into chat with cheats on, or into a command block
Summon command
/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:1,type:"minecraft:plains"}} Java Edition 26.3. Summons at your feet. 114 characters
How the Minecraft villager trade command works
VillagerData, Offers, and what each trade field does
/summon minecraft:villager ~ ~ ~ {...} spawns a villager at your feet with the
entity data in braces. VillagerData holds three values: the profession, the level from 1 to 5 (Novice,
Apprentice, Journeyman, Expert, Master) and the biome type, which sets the
villager's outfit: desert, jungle, plains, savanna, snow, swamp or taiga.
Offers:{Recipes:[...]} is the list of trades. Without it the game generates
the villager's offers the first time the trading menu opens. With it, every entry is one trade: buy is the first cost item, buyB is an optional
second cost item, and sell is what the player receives. Each item is a compound with
an id and a count from 1 to 99, and any item can
be stacked that high regardless of its normal stack size. Not sure of an item's ID? The item ID list has every one.
maxUses is how many times a trade works before it is disabled; villagers refill
their stock when they activate their offers at their job site, up to twice a day. rewardExp controls whether the player gets XP orbs, and xp is the experience the villager gains, which fills its trading bar. A villager
moves up a level at 10, 70, 150 and 250 total XP, so the command also writes Xp to match the level you pick. priceMultiplier sets how strongly demand and reputation move the price. The wiki
lists 0.05 for most trades and 0.2 for gear, maps and enchanted items, which are the two choices here.
A villager that a player has traded with keeps its profession forever and locks in its offers. Villagers without a job do not trade, so Unemployed is not offered. This is Java Edition syntax and will not run as-is on Bedrock.
Worked example
A level 3 desert armorer named Gem Dealer who sells one diamond chestplate for 8 emeralds and 2 iron ingots, 4 uses, 10 villager XP:
/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:armorer",level:3,type:"minecraft:desert"},Xp:70,CustomName:"Gem Dealer",Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:8},buyB:{id:"minecraft:iron_ingot",count:2},sell:{id:"minecraft:diamond_chestplate",count:1},maxUses:4,rewardExp:true,xp:10,priceMultiplier:0.2f}]}} Level 3 writes Xp:70, the lowest XP for Journeyman, and the price multiplier is 0.2
because it is a piece of armour.
More Minecraft tools
Other command builders and item references
Frequently asked questions
Offers, stock, XP and limits
How do I summon a villager with custom trades? +
Run /summon minecraft:villager ~ ~ ~ with an Offers tag: Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:3},sell:{id:"minecraft:diamond",count:1},maxUses:9999999}]}. Each entry in Recipes is one trade. This generator writes the whole command, including VillagerData, so you only pick the items.
How many times can a trade be used? +
maxUses sets how many times the trade works before it is disabled. A villager refills its stock when it activates its offers at its job site, up to twice a day. Set maxUses to 9999999 for a trade that effectively never runs out.
What do Reward XP and Villager XP do? +
Reward XP (rewardExp) decides whether the player gets experience orbs after each trade. Villager XP (xp) is how much experience the villager itself gains from the trade, which is what fills its trading bar and unlocks the next level.
Why can't I pick an unemployed villager? +
Villagers without a job do not trade, so the generator leaves Unemployed out. Nitwit is included because the wiki's own summon example gives one trades, but a nitwit never gets level trading stones.
Can I add enchantments or custom names to the items? +
Not here. Each item is written as just an id and a count, which is the part of the item format this tool checks against the wiki. Enchanted books and renamed items need item components added to the command by hand.
Command syntax checked for Minecraft 26.3