Skip to main content
3 of 3
1.21
aytimothy
  • 17.8k
  • 17
  • 83
  • 140

The /kill command does not support killing objects (not yet anyway) who fit through a NBT citeria. Only identifiers with the @e command will be considered.

When you entered:

kill @e[type=Item] {Item:{tag:{display:{Name:"RedFlag"}}}
kill @e[type=Item] {Item:{id:"red_flower",Damage:2}}

It is considered as:

kill @e[type=Item]
kill @e[type=Item]

Regardless of how much NBT data an object has, it'll always kill all the entities of the type specified.


This means that /kill @e[type=Sheep] {CustomName:"Sheep"} will kill all sheep(s) in the world. Even if they have/don't have the custom name "Sheep", or a completely different name altogether.
Think about all the sheeps! (Those loaded in anyway)


Edit: As of 1.21, you can use nbt as a selector, for example:

kill @e[type=sheep,nbt={CustomName:"Sheep"}]
aytimothy
  • 17.8k
  • 17
  • 83
  • 140