NapNodes
Free tool · Minecraft Java

Minecraft villager trade generator

Set what the player pays and what they get, as many rows as trades you want, and choose what the villager looks like. The /summon command appears below, written the way your server's version understands it. It's the simplest way to set up a shop at spawn without installing any plugin.

Trades (2 of 12)

/summon minecraft:villager ~ ~ ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Offers:{Recipes:[{buy:{id:"minecraft:diamond",count:1},sell:{id:"minecraft:emerald",count:8},maxUses:2147483647,rewardExp:0b,xp:0,priceMultiplier:0f},{buy:{id:"minecraft:emerald",count:20},sell:{id:"minecraft:enchanted_book",count:1,components:{"minecraft:stored_enchantments":{"minecraft:mending":1}}},maxUses:2147483647,rewardExp:0b,xp:0,priceMultiplier:0f}]},CustomName:{"text":"Shopkeeper","color":"gold"},CustomNameVisible:1b,NoAI:1b,Invulnerable:1b,PersistenceRequired:1b}
592 characters

Over 256 characters: the game chat cuts it off. Paste it into the server console (without the slash) or a command block.

How to use it

  1. Make yourself an operator: in the server console, op YourName (see the admin commands guide).
  2. Stand where you want the villager: with ~ ~ ~ it appears right where you are.
  3. It almost always goes over 256 characters, the chat limit. Paste it into the server console without the slash (then swap ~ ~ ~ for coordinates, since the console isn't anywhere in the world) or into a command block, which takes up to 32,500.

Ideas for a server shop

  • Currency exchange: diamonds for emeralds and back, so emeralds become the server's money.
  • Books you can't find: Mending or Sharpness V for a lot of emeralds, so rare things are earned by playing.
  • Buy what people have too much of: rotten flesh, bones or cobblestone for an emerald; it empties chests and gives new players something to do.
  • Second payment: the villager can ask for two things at once, like a book and emeralds, just like the game's librarian.

If you want player-to-player shops with real money and no villagers, see the Minecraft server economy guide.

The three forms of the command

Since 1.20.5 items use count (before, Count with a b after it) and enchanted books keep their enchantment in a component; since 1.21.5 the villager's name is plain text without single quotes and the book has no levels. A server only understands its own: that's why you pick the version here. Before 1.14 villagers were different and aren't covered.

Frequently asked questions

Why does my villager run out of trades?

Each trade has a number of uses, and the villager restocks them by working at its job site block. If it can't move, it never works and never restocks. That's why uses are unlimited here unless you say otherwise: a spawn shop never sells out.

Why does the price change?

In the game, a price goes up when a trade is used a lot and down when the villager likes you (for example, after you cured it from a zombie). With «Fixed price» the command has priceMultiplier:0f, so neither demand nor reputation moves it. The only thing that still lowers it is the Hero of the Village effect, which the game applies separately.

Will it get trades I didn't add?

No: every trade has xp:0, so the villager earns no experience, never levels up and the game doesn't add trades of its own. The level you pick only changes the badge on its belt.

How do I remove it if I get it wrong?

Standing next to it, /kill @e[type=villager,limit=1,sort=nearest] removes the closest one (for the wandering trader, type=wandering_trader). /kill works even if it's invulnerable.

Does it work in Bedrock?

No. In Bedrock you can't set a villager's trades with /summon; that's done with a behavior pack. This generator is for Minecraft Java, Paper servers included.

No server yet?

At NapNodes you get a free Minecraft server, no card needed, with the panel console to paste these commands into. And if you want to play with no queue and the server always on, plans come with RAM reserved just for you and the load on each machine is public on the status page.

Create your free server

Need a different item for a reward? The /give generator writes it for your version.

More free tools

All the tools