mojira.dev
MC-96099

Motion NBT Tag is broken for players

I created a contraption which is supposed to set any entity's score of an "isMoving" objective to 0 if it has a motion of {Motion:[0.0,0.0,0.0]} (if it's still), otherwise the value defaults to 1.

Unfortunately the value is constantly set to 0 even though the player is moving, unless you're sprinting + jumping at the same time. But it works for mobs.

This ruins a quick way for mapmakers to determine whether the player is standing perfectly still or not.

See a video of the bug in action here : https://youtu.be/lkKwvwwA0xo

Linked issues

Comments 4

It's not a bug, it's how partial list detection works. Each record you define is scanned throughout the entire list on the target. The first 0.0 is looked through all 3 slots on the target, and the second and third 0.0 will do the same (causing redundant searches). It's the same as Motion:[0.0]. The order you define the records is not the order the game looks for them.

So it's set to 0 because it detects a 0.0 motion on the Y axis, eventhough the X and Z axis are not equal to 0.
Is there any way to test for an absolute 0 motion on every axis ?

Because if I want to rely on scoreboard objectives I must have a sprintOneCm, sneakOneCm, walkOneCm, that sets the isMoving score to 1, and an additional command that sets the isMoving score to 1 if {onGround:0b}

That's correct, and unfortunately you cannot detect that reliably with NBT data. You'll need to use the scoreboard objectives.

The partial list detection is what allows us to detect essentially any list data without having to specify every single record. For example, without it, we wouldn't be feasible to detect anything in the player's inventory since we'd have to list out every possible combination of items existing in their inventory if checking just a specific slot.

Duplicates MC-73887

Simon

(Unassigned)

Unconfirmed

Minecraft 1.8.9, Minecraft 16w02a, Minecraft 16w03a

Retrieved