Minecraft Blockdata. Cannot Put A Specific Spawn Egg in A Chest (Minecraft 1.10.2)

minecraft-commandsminecraft-java-edition

I'm trying to put a specific spawn egg in a chest using blockdata for a project I'm doing. I'm trying to put a blaze spawn egg with enchants, and a custom name. I know the data value for a blaze is 61, however when I put this command in and press the button the chest has a white spawn egg that spawns nothing. Anyone know how to fix this?

Here's my command:

/blockdata ~ ~1 ~ {Items:[{id:spawn_egg,Count:1,Damage:61}]}

Also, can anyone figure out how to add a custom name and enchant? Thanks!

Best Answer

As of 1.9, spawn eggs use the EntityTag compound to specify the entity's name ID, rather than the Damage value of the item.

All tags for items that are not the root id, Damage, Count, and Slot must be placed within a single tag compound.

The following provides a blaze spawn egg enchanted with Sharpness 3, and with a custom display name.

/blockdata ~ ~1 ~ {Items:[{id:"minecraft:spawn_egg",Count:1,tag:{EntityTag:{id:"Blaze"},ench:[{id:16s,lvl:3s}],display:{Name:"Custom Name"}}}]}

You can find all item NBT data here.