Minecraft – How to add scoreboard value to a certain item entity [post 1.13]

minecraft-commandsminecraft-java-edition

I have a command, what sets the score of an item entity dropped by a mob.

/scoreboard players set @e TMNextStage 1 {Item:{id:"minecraft:flint",Count:1b,tag:{display:{Name:"TMNextStage"}}}}

What is the 1.13+ version of this command? I couldn't find anything about targeting the right item.
Thanks for the answers in advance!

Best Answer

It's directly in selector arguments now. So you could use this:

scoreboard players set @e[nbt={Item:{id:"minecraft:flint",Count:1b,tag:{display:{Name:"TMNextStage"}}}}] TMNextStage 1

But you could also directly do things for them, for example like this:

tp @e[nbt={Item:{id:"minecraft:flint",Count:1b,tag:{display:{Name:"TMNextStage"}}}}] @s

Also, if you add type=item to the selector, performance improves, because Minecraft doesn't need to check the NBT of every entity.