mojira.dev
MC-126881

summoned item with custom NBT doesn't get detected as item anymore

summoning an item with custom NBT like

summon minecraft:item ~ ~ ~ {Item:{id:"minecraft:blaze_spawn_egg",Count:1, tag:{display:{Name:"spawn_this"}}}}

won't get detected as item in general anymore if the player moves it in his inventory and then drops it.

@e[type=minecraft:item, limit=1, distance= 5]

won't find the egg anymore. But if the player drops the egg without moving it first, the identifyer will find it.

... I'm using

execute at @e[type=minecraft:item, nbt={Item:{id:"minecraft:blaze_spawn_egg" ,tag:{display:{Name:"spawn_this"}}}}] run summon minecraft:blaze

in minecraft:tick to summon a blaze whenever the egg gets dropped by a mob

which behaves like described above.

... in the current game session even normal items on the ground don't get detected ... I'm not sure what is going on here
summoning the egg and having the blaze spawned automatically still works though

OK, the "distance" filter seems to be buggy. Using it no entity will be detected no matter how high I set its value.
But that is a different bug

Comments 2

  1. Your selector is incorrect. It should be:

    @e[type=minecraft:item,limit=1,distance=..5]
  2. Custom names now use text components:

    tag:{display:{Name:"{\"text\":\"spawn_this\"}"}}

the distance thing put aside, are you suggesting having it work the way I did it actually is the bug? Because the spawning works until the egg got moved (left-clicked with the mouse) in inventory. So I guess clicking the item makes the nbt update and break.

by the way... what a horrible mess of escaping having to use json format inside a json string field:

"tag": "{display:{Name:\"{\\\"text\\\":\\\"spawn_this\\\"}\"}}"

Dobrand

(Unassigned)

Unconfirmed

NBT, detect, item-entity

Minecraft 18w10b

Retrieved