I've tried A LOT of different syntaxes and nothing has allowed me to reach my goal. I want to create a Villager that A) sells spawners (I've been able to do this) and B) have those spawners spawn mobs other than pigs. So like a zombie or something. From there I could name him a "Zombie Spawner Trader" or something like that. Keep in mind, my villager is being created no problem and he's buying and selling things according to what I've programmed, all that's wrong is that the spawner is only spawning pigs. I have tried NBT tags: "Entity", "EntityId" and "SpawnData" with their proper syntaxes according to the wiki, and none of them worked. It proceeded to give me a pig spawner as usual.

Some code:

/summon villager ~ ~1 ~ {CustomName:"Zombie Spawner Merchant",CustomNameVisible:1b,NoAI:1b,Invulnerable:1b,Offers:{Recipes:[{buy:{id:"minecraft:gold_nugget",tag:{display:{Name:"Gold Coin",Lore:["$1"]}},Count:32},sell:{id:"minecraft:mob_spawner",Count:15,tag:{SpawnData:{id:"minecraft:zombie"}}}]}}
  • I don't believe this is possible currently. I believe any NBT data you save to the spawner item is eliminated when the spawner is placed and converts to a block. People have long been asking how to use the give command to give a monster spawner with custom spawns and I have never seen any answer except mods/plugins. The only way it could be done is by having the villager trade a spawn egg to convert a regular spawner. – IronAnvil Nov 26 '17 at 2:22
  • 5
    Possible duplicate of Mob Spawners Survival 1.14.4 – pppery Jan 21 '20 at 20:17

This command will summon villager that will trade 32 coins for two zombie spawn eggs. It will also trade 1 zombie spawn egg for a monster spawner. The player can then combine the two to make a zombie spawner.

/summon villager ~ ~1 ~ {Invulnerable:1b,CustomName:"Zombie Spawner Merchant",CustomNameVisible:1b,NoAI:1b,CareerLevel:1,Offers:{Recipes:[{buy:{id:"minecraft:spawn_egg",Count:1b,tag:{CanPlaceOn:["minecraft:mob_spawner"],EntityTag:{id:"minecraft:zombie"}}},sell:{id:"minecraft:mob_spawner",Count:15b}},{buy:{id:"minecraft:gold_nugget",Count:32b,tag:{display:{Name:"Gold Coin",Lore:["$1"]}}},sell:{id:"minecraft:spawn_egg",Count:2b,tag:{CanPlaceOn:["minecraft:mob_spawner"],EntityTag:{id:"minecraft:zombie"}}}}]}}

Its a bit hacky I know, but I'm pretty sure that villagers wont trade for custom spawners.

Please also note, this solution will only work in 1.12.2 and lower. You can only run this command in creative mode as the commands available in survival mode are more limited.

  • Are you sure this actually works in non-creative mode? – pppery Jul 17 '19 at 21:47

use this and make sure to replace the mob name from MOBNAME to something else

/summon villager ~ ~ ~ {VillagerData:{level:1,profession:"minecraft:armorer",type:"minecraft:desert"},Offers:{Recipes:[{sell:{id:"minecraft:spawner",Count:1b,tag:{BlockEntityTag:{SpawnData:{id:"minecraft:MOBNAME"}}}}}]}}

this will spawn a dessert armorer with a trade for a mob

  • Hi Eli, can you show that this works in the Java Edition? Can you post a screenshot, for example? – Joachim Nov 3 '19 at 19:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.