I was messing around with villagers in creative mode, and creating some with custom trades. I wanted to make a villager that cannot be traded with, so I used this command:
/summon Villager ~ ~1 ~ {Offers:{Recipes:[{maxUses:1,buy:{id:,Count:1},sell:{id:,Count:1}}]},Profession:3,CustomName:"Npc1",CustomNameVisible:1}
This command summons a proper villager with blank slots in its trade menu. However, closing and reopening the world causes the chunk the villager is in to revert to what it was before the villager was spawned. Summoning a villager with actual item IDs will not cause this error. For example:
/summon Villager ~ ~1 ~ {Offers:{Recipes:[{maxUses:1,buy:{id:"minecraft:barrier",Count:1},sell:{id:"minecraft:barrier",Count:1}}]},Profession:3,CustomName:"Npc1",CustomNameVisible:1}
Although villagers with blank trades was probably not intended to exist, I think that this bug could use to be fixed just to make stuff look better... Without losing tons of work in one chunk.
Linked issues
Comments 3
According to this video, this can happen as a result of old villager trades updating to a newer version. It was probably because the conversion from numeric IDs to named IDs failed in one of the farmer villager's trades. Etho has been using the snapshots, so I'm not sure if updating a world from 1.7 to 1.8 directly would cause the same problem. Also, those villagers were quite old; I'm not sure if the same thing would happen to newer villagers or not.
Oddly enough, both villagers in the affected chunk had to be killed, even though only one of them had a bugged trade.
According to this video, this can happen as a result of old villager trades updating to a newer version. It was probably because the conversion from numeric IDs to named IDs failed in one of the farmer villager's trades. Etho has been using the snapshots, so I'm not sure if updating a world from 1.7 to 1.8 directly would cause the same problem. Also, those villagers were quite old; I'm not sure if the same thing would happen to newer villagers or not.
Oddly enough, both villagers in the affected chunk had to be killed, even though only one of them had a bugged trade.
Getting: