mojira.dev
MC-131893

NBT target selector argument not working with mobs

I was playing around with the new execute command for Minecraft 1.13. I tried to create a stone block above all sheep within 10 blocks with the command: 

/execute at @e[type=minecraft:sheep,distance=..10] run setblock ~ ~3 ~ minecraft:stone replace

Which worked perfectly fine. Then I tried to do the same thing but only to white sheep with the command:

/execute at @e[type=minecraft:sheep,distance=..10,nbt={Color:0}] run setblock ~ ~3 ~ minecraft:stone replace

There were no errors with the command but none of the white sheep had stone blocks placed above their heads. I tried this with a simpler command: 

/say @e[nbt={Color:0}]

Which also did not work. I also tried similar things with the NoAI tag with sheep, cows, pigs and zombies which also did not work.

I noticed, however, that if I held a stick and ran the command:

/say @e[nbt={SelectedItem:{id:"minecraft:stick"}}]

It would indeed say my name.

I tried doing a similar thing with a zombie holding a stick:

/say @e[nbt={HandItems:[{id:"minecraft:stick",Count:1}]}]

which did not return anything.

Note: If you write @e[nbt={}], the commands will return a result for all entities.

If I had to guess, this is probably a bug with using the NBT target selector argument on non-player entities. I sure hope Mojang fix the bug before the release.

Comments 1

Use the correct data suffixes, such as Count:1b

Seacraft Gaming

(Unassigned)

Unconfirmed

Minecraft 1.13-pre3

Retrieved