-
Bug
-
Resolution: Unresolved
-
None
-
Minecraft 1.8, Minecraft 15w49b, Minecraft 16w04a, Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w36a, Minecraft 16w38a, Minecraft 16w39a, Minecraft 16w39b, Minecraft 16w39c, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w42a, Minecraft 16w43a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13b, Minecraft 17w15a, Minecraft 17w16b, Minecraft 17w17a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w50a, Minecraft 18w06a, Minecraft 1.13-pre7, 1.15.2, 20w06a, 20w13b, 1.16.1, 1.16.2 Pre-release 2, 1.16.2 Release Candidate 1, 1.16.2, 1.17.1, 1.20.4, 1.21 Pre-Release 1
-
None
-
Confirmed
-
Commands
-
Low
-
Platform
The NBT list comparison (like it is used for the /testfor or /scoreboard command only tests if an item is in the list, but ignores the position.
Example:
/summon item ~2 ~ ~ {Item:{id:stone,Count:1,tag:{display:{Lore:[A,B,C]}}}}
/execute if entity @e[type=item,limit=1,nbt={Item:{tag:{display:{Lore:[A]}}}}] run say test (works as "A" is in "Lore") /execute if entity @e[type=item,limit=1,nbt={Item:{tag:{display:{Lore:[A,C,B]}}}}] run say test (works as "A", "C" and "B" are in "Lore") /execute if entity @e[type=item,limit=1,nbt={Item:{tag:{display:{Lore:[A,C,B,D]}}}}] run say test (doesn't work as "D" is not in "Lore")
This is mostly problematic when testing for numbers like for example:
/execute if entity @s[nbt={Motion:[0d,0d,0d]}] run say test
as this would return true if 0d is in "Motion", that means however that the other two numbers in "Motion" can be anything.
Note: Maybe this is the intended feature, if so it would be appreciated if the developers find a way to make direct comparison possible (maybe by saying if a list contains the same amount of items as the to-compare list, then try comparing it directly).
Original description:
There is a bug where using the /testfor ArmorStand command with a specified NBT Rotation value of
{0.0f, 0.0f} returns all Armor Stands, regardless of rotation. Using a Rotation value other than {0.0f, 0.0f}works as expected. This happens when your command is run in a command block or from the chat. I haven't tested this with anything other than armor stands.
This command returns only armor stands with the specified rotation:
/testfor @e[type=ArmorStand] {Rotation:[45.0f,0.0f]}
This command returns all armor stands, regardless of rotation.
/testfor @e[type=ArmorStand] {Rotation:[0.0f,0.0f]}
To reproduce, place stand with 45 degree rotation, and place a stand with 0 degree rotation. Run the two commands above. The first will give one result, the second will return two results.
- is duplicated by
-
MC-80649 Can't detect the Motion tag of non-mob-entities
- Resolved
-
MC-93929 Detecting Players not moving
- Resolved
-
MC-96099 Motion NBT Tag is broken for players
- Resolved
-
MC-133369 Motion NBT tag in execute selectors doesn't seem to be checking actual values
- Resolved
-
MC-193015 HandItems issue
- Resolved
-
MC-234626 Armor Stand Rotation:0 Detect All Armor Stands
- Resolved
-
MC-272657 The Motion NBT data turns into 0, 0, 0 when a entity walks direction south or east.
- Resolved
- relates to
-
MC-124532 NBT data partly ignored in execute command
- Resolved