How do I summon an item with a custom name? [duplicate]

I'm trying to summon a potion item with a custom name. I did use

/summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:potion",Count:1b},display:{Name:'{"text":"Teleporter","italic":"false"}'},PickupDelay:8}

But it doesn't have the name I want. It has the normal uncraftable potion name.

Does anyone know how to fix it? I'm on Java 1.18.1.

5

1 Answer

The display key has to be under both the Item key and another key called tag. The full command would look like this:

/summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:potion",Count:1b,tag:{display:{Name:'{"text":"Teleporter","italic":"false"}'}}},PickupDelay:8}

The minecraft wiki has information on the entity data structure of items here.

You Might Also Like