MC CommanderUnofficial Minecraft command tools
Villager Trade Generator

Villager Trade Generator

Create custom villager summon commands with trades.

How to use

Configure the villager and its trades. Custom trade NBT is a Java Edition feature and is not interchangeable with Bedrock commands.

Basic fallback generator

A simplified form is available while the main generator loads. It does not include every setting in the full tool.

Output

Villager trade generator notes

Villager trade data is version-sensitive. Start with one simple trade, confirm it works, then add more offers.

Examples and checks
  • Confirm buy and sell item IDs.
  • Set a sensible maximum use count.
  • Long villager commands are easier to run from a command block.

A complete one-trade shop (Java 1.20.5 and later)

/summon minecraft:villager ~ ~1 ~ {VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:3},sell:{id:"minecraft:diamond",count:1},maxUses:9999}]},NoAI:1b,Invulnerable:1b,PersistenceRequired:1b}
PartMeaning
VillagerDataProfession, level (5 = master, so trades do not change) and biome look
buy / sellWhat the player pays and receives. Add buyB for a second cost item
maxUsesHow many times the trade can be used before it locks
NoAI, Invulnerable, PersistenceRequiredThe shopkeeper stands still, cannot be killed and never despawns

Add more trades by putting more {buy:…,sell:…} entries inside Recipes, separated by commas. On 1.20.4 and earlier, item counts are written Count:3b with a capital C.

Villager trade generator FAQ

How do I make a trade that never runs out?

Set maxUses to a large number such as 9999. A trade locks only when its use count reaches maxUses.

How do I stop the villager from changing its trades?

Give the villager level:5 in VillagerData. A master-level villager does not unlock new offers, so the list you wrote stays as it is.

Can a trade cost two different items?

Yes. Add buyB next to buy, for example buy:{id:"minecraft:emerald",count:10},buyB:{id:"minecraft:book",count:1}.

Can the villager sell an enchanted item?

Yes. On Java 1.21 and later, add components to the sold item: sell:{id:"minecraft:diamond_sword",count:1,components:{"minecraft:enchantments":{"minecraft:sharpness":5}}}.

Does the villager trade generator work on Bedrock Edition?

No. Bedrock's /summon cannot set trades, so custom trades there need an add-on (behavior pack). The generator still outputs a plain Bedrock summon command when you choose Bedrock.

Step-by-step guides

Related guides

Separate spawning from custom trades

Begin with /summon minecraft:villager ~ ~1 ~. That only summons a villager; it does not create custom offers. In Java Edition, custom trade data uses the version-dependent villager Offers structure. Bedrock Edition's ordinary summon command cannot accept the same Java trade NBT.

Build one offer before a full shop

  1. Choose a supported Java version.
  2. Specify the cost item and count, then the item delivered.
  3. Generate a single trade, inspect the output and test in a separate world.
  4. Only then add multiple offers or advanced item data.

If you selected Bedrock, do not expect Java custom trade commands to work unchanged. A normal summon and custom shop behavior are different requirements.

These are explanatory examples, not a claim that every Minecraft release has been tested in-game.