Minecraft – How to give a named squid egg to a player

minecraft-java-edition

I am running Minecraft 1.9 and I am trying to give the player a squid egg with a custom name of "Create Script".

This is the command I have used:

/give chrisdude011 minecraft:spawn_egg 1 94 {EntityTag:{id:"Squid",CustomName:"Create Script",ench:[]}}

However, this only gives me the spawn squid egg with nothing else.

Any ideas what to do?

Best Answer

The squid is indeed spawned with the specified custom name. If you are talking about the enchantment overlay (via ench:[]), you specified it in the wrong depth, causing it to be potential entity data instead of item data.

As well, spawn eggs do not use Damage values anymore, thus a value of 94 is invalid and will default back to 0.

Fixed command, moving ench:[] to the root of the tag tag:

/give chrisdude011 minecraft:spawn_egg 1 0 {ench:[],EntityTag:{id:"Squid",CustomName:"Create Script"}}

For the display name of the item itself, you use the Name string inside the display compound. Example:

/give chrisdude011 minecraft:stone 1 0 {display:{Name:"Create Script"}}

With your spawn egg:

/give chrisdude011 minecraft:spawn_egg 1 0 {ench:[],display:{Name:"Create Script"},EntityTag:{id:"Squid",CustomName:"Create Script"}}
Related Topic