The bug
When you summon an enderman with carried:0s
, it is treated as if the enderman is holding nothing, however if the enderman is holding nothing the carried
tag is not written to the NBT data.
This is pretty inconsistent because if 0s
is treated as holding nothing, you would expect it to be saved to NBT if the enderman is holding nothing as well.
From MC-94027:
In 1.8 versions is possible to test if a enderman don't carries a block
How to reproduce
Summon an enderman holding nothing
/summon enderman ~ ~ ~ {carried:0s}
Try to test for
carried:0s
/testfor @e[type=enderman] {carried:0s}
1.13:
/execute as @e[type=enderman,nbt={carried:0s}] run say enderman with nothing
→ The command fails
Linked issues
Comments 7
Confirmed for 17w46a Snapshot, but now the commands to reproduce the bug are:
/summon enderman ~ ~ ~ {carried:0s}
/execute as @e[type=enderman,nbt={carried:0s}] run say enderman with nothing
carried
has been removed in favor of carriedBlockState
. When carriedBlockState
is set to air, it is not saved to NBT.
Perfect, but that's still the same as it was before because ideally it should be saved as "minecraft:air"...
Anyway with the addition of selectors that read NBTs it's easier to find a solution for people who need it in their command systems.
This a simple solution to find a endermen holding nothing:
/execute as @e[type=enderman,nbt=!{carriedBlockState:{}}] run say enderman with nothing
For me is fixed this bug!
Can confirm for MC 1.12.1.