Presets

Summon presets

Minecraft Custom Villager Trades Command

Custom villager trades are complex because the useful data sits inside Offers. This article keeps the shop idea, villager identity, trade costs, sold items, max uses, and tags in one place before you copy the summon command.

Preset result

A persistent villager shop preset with two editable trades and a stable tag for later command-pack logic.

Output

Villager trades summon output

/summon minecraft:villager ~ ~ ~ {CustomName:{text:"Relic Trader",color:"gold"},CustomNameVisible:1b,PersistenceRequired:1b,VillagerData:{profession:"minecraft:librarian",level:5,type:"minecraft:plains"},Offers:{Recipes:[{buy:{id:"minecraft:emerald",count:12},sell:{id:"minecraft:enchanted_book",count:1,components:{"minecraft:stored_enchantments":{"minecraft:mending":1}}},maxUses:999999,rewardExp:0b},{buy:{id:"minecraft:diamond",count:3},sell:{id:"minecraft:player_head",count:1,components:{"minecraft:custom_name":{text:"Relic Token",color:"aqua",italic:false}}},maxUses:64,rewardExp:0b}]},Tags:["relic_trader"]}
Too long for Minecraft chat

The longest command line is 616 characters, 360 over the 256-character chat input limit. Pasting it into chat can truncate the line and make Minecraft report a syntax error even when the generated command is valid.

  • Use a Command Block: run /give @s command_block, place it, then paste this command into the block command field.
  • Use a .mcfunction for a reusable datapack: save the line without the leading slash at saves/<world>/datapacks/<pack>/data/<ns>/function/<name>.mcfunction with a minimal pack.mcmeta, run /reload, then run /function <ns>:<name>. Do not paste .mcfunction content into chat.

Preset screenshot

The NBTForge workbench state used for the minecraft custom villager trades command article, including the visible controls and generated output.

Build the preset

  1. Open Summon and choose villager as the entity.
  2. Set VillagerData first so the profession, biome type, and level match the shop role.
  3. Add each trade as a buy and sell pair inside Offers.Recipes.
  4. Add PersistenceRequired and a tag so the shop can be found or protected by later commands.

Trade data is nested

Villager trade commands are hard to debug because item data can appear inside buy, buyB, or sell. Keep one trade simple until it works, then add more recipes.

NBTForge is useful here because the command can sit beside related item presets. Build the sold item first, then paste or recreate that item as the sell stack.

  • Use maxUses for permanent shops.
  • Use rewardExp:0b when trades should not level the villager.
  • Use tags for cleanup, protection, or region logic.

Map economy workflow

A villager shop usually belongs in a larger command pack. Pair the summon command with a region setup, a title prompt, or a backup clear command for test villagers.

Keep trade costs readable. If a shop needs rare currencies, create the currency item as its own Give preset first.

Fit the preset into a real project

Treat Minecraft Custom Villager Trades Command as a tested starting point, not just a copied string. After the output works once, save it with a clear Project name, note the target Minecraft version, and keep the preset near related setup commands such as scoreboard, bossbar, loot, or reset lines.

Before publishing the preset to a map, server, or command pack, run it from the copied artifact rather than only from the live workbench. That catches missing dependencies, stale selectors, wrong edition choices, and commands that only worked because local test state already existed.

  • Keep the selected Edition and Version with the shared command.
  • Test selectors against a harmless command before using damage, kill, clear, or teleport.
  • Move long commands into Project or a function-style workflow instead of pasting them into chat.
  • Recheck warnings after changing entities, item components, passengers, or datapack resources.

FAQ

Can I sell custom named items in villager trades?

Yes. The sell item can include item components or NBT, depending on the selected Java version family.

Why does my custom villager disappear?

Add PersistenceRequired and test the command in the target difficulty and region. Also keep a tag so you can find the shop entity later.

When should this preset become part of a command pack?

Use it as a command pack entry when the output depends on setup lines, reset commands, loot resources, scoreboard state, or repeated testing. Single safe commands can still be copied directly from Output.

Open this workflow

Start from the related Summon workbench, then adjust the preset fields for your world.