How do I prevent new villager trades from spawning?
When making a custom adventure map, usually you only want the trades you programmed into a villager to show up. By default, however, the game will try to spawn new trades when the last one is made. The classic way I'm seeing in tutorials to prevent new trades is to make the last trade untradeable; however, with the release of 1.7, a lot of the old item IDs that were unobtainable have been removed from the game altogether, and following the tutorial I have crashes the game when the trade interface is scrolled to the last trade.
So there's two parts to this question:
- Is there a better way to prevent new trades with the 1.7 mechanics? Or with the snapshots of 1.8 mechanics?
- If not, what is a safe data ID to use to prevent the last trade from being a real trade as of 1.7?
Best Answer
I don't know much about custom villager trading, and a cursory glance over the NBT structure of villagers didn't reveal anything new to me.
As for your second point, there's a perfect technical block that should work for the newer versions: The Barrier.
Not only is it unobtainable without creative/commands, but it's icon is this:

It's itemID is barrier, so you can try
/summon Villager ~ ~ ~ {
Offers:{Recipes:[
{maxUses:1337,buy:{id:diamond},sell:{id:emerald}},
{maxUses:1,buy:{id:barrier,tag:{display:{Name:No More Trades}}},sell:{id:barrier,tag:{display:{Name:No More Trades}}}}
]}}
Which sells renamed Barriers for renamed Barriers. You might need to use minecraft:barrier instead of just barrier, I'm not sure about that.
Pictures about "How do I prevent new villager trades from spawning?"



How do you make villagers stop changing trades?
This can be accomplished by destroying the job site of the desired villager. The player can then replace it and hope that the villager's trade will be different. This may have to be done a few times for the desired trades to be available. Again, if a player trades with a villager, their trade can no longer be changed.How do you stop villagers from spawning?
They need a work station since taking jobs is part of their programming. Put job blocks near them and they will permanently lock to the block. After they have a job, they will start restocking trade materials in no time. It works like magic!How do you stop villagers from restocking?
Villagers increase their prices when you trade a lot of the same item and reduce the price back to normal after couple of in-game days. It's usually best to have a few of the same type of villagers, so you can max out the trade of one villager and trade with another one the next day.How to reset villager trades in Bedrock with NO TOOLS!!
More answers regarding how do I prevent new villager trades from spawning?
Answer 2
I'm almost one hundred percent certain that the other comment won't work. However, what will work is this:
/summon Villager ~ ~ ~ {CustomName:Billy,Profession:4,CareerLevel:6,Offers:{Recipes:[{maxUses:99999,buy:{id:"minecraft:emerald",Damage:0,Count:10},buyB:{id:"minecraft:book",Damage:0,Count:1},sell:{id:"minecraft:dye",Damage:5,Count:20}}]}}
When this command is triggered, it will summon a villager with the name Billy, who wears a white apron. He will trade you 20 purple dyes for 10 emeralds and 1 book. An odd trade to be sure, but it works.
I know you've probably either given up or found a work around by now, but this is for those who stumble across this question/answer later.
Answer 3
You can't make them stop spawning in new trades, I made a lucky block that spawns a lucky villager but he keeps leveling up his trades.
Answer 4
Use entitydata each time player is traded using scoreboard of stat.tradedWithVillager to reset the trade of the villager. It could lag if there is too much villager, but I think this is the best way to prevent from new trade.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Sorapong Chaipanya, Brett Sayles, Sorapong Chaipanya, Sorapong Chaipanya
