Minecraft – Custom Minecraft 1.8 spawners

minecraft-commandsminecraft-java-edition

I am working on a minecraft 1.8 server and am trying to make a mob spawner that spawns items. This example:How can I make a spawner that summons Items? works on new versions of minecraft but not on 1.8. It seems that any mob spawners placed down by command blocks don't work. The following command:

/setblock ~ ~1 ~ mob_spawner 0 replace {SpawnData:{id:zombie},Delay:299}

Creates an empty mob spawner that does not spawn anything. I am using minecraft forge with worldedit but no other mods. How can I fix this?

Best Answer

The below code is generated from mcstacker 1.8, 1.9, and 1.10 version. The following code should place a zombie spawner.

/setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {EntityId:Zombie,Delay:299}

The next command should place a spawner that spawns diamonds.

/setblock ~ ~1 ~ minecraft:mob_spawner 0 replace {EntityId:Item,SpawnData:{Item:{id:diamond,Count:1}},Delay:299}

Try that. The command isn't tested, but mcstacker usually works for me. It may not for you because you are on a server. You can change it with mcstacker. I hope this helps.