mojira.dev
MC-272657

The Motion NBT data turns into 0, 0, 0 when a entity walks direction south or east.

I used commands to visualize it:

Repeating Commandblocks:

execute as @n[type=pig,nbt={Motion:[0.0,0.0,0.0]}] run say standing

execute as @n[type=pig,nbt=!{Motion:[0.0,0.0,0.0]}] run say moving

This Bug only effects entities facing into the south and the east towards the positive coords.

So {Motion:[1.0,0.0,0.0]} and {Motion:[0.0,0.0,1.0]} turn into {Motion:[0.0,0.0,0.0]}.

Linked issues

Attachments

Comments 5

Can confirm

This is a misunderstanding. NBT list checks only check that each value exists in the list, so you are checking for 0 on any axis redundantly 3 times. See MC-73887

No, the issue is that i am checking if the motion is 0.0,0.0,0.0 and a moving entity tests positive! You missunderstood me i think

"nbt={Motion:[0.0,0.0,0.0]}" is identical to "nbt={Motion:[0.0]}"; including the same number multiple times is redundant. It will pass for anything that is still on any axis. Like the Y axis for example. Your entity doesn't appear to be moving vertically. There is no way to check for exact positional NBT list equality as you are trying to do with the nbt selector parameter.

I did not know that 0.0,0.0,0.0 is the same as 0.0. But i was only testing IF the entity is moving and it worked just fine in every situation except when the entity walked in a straight line direction south or east. Did you try the commands or watch the video i pinned? It shows how the command detects the movement and then after just a few seconds stops. 

qnoss

(Unassigned)

Community Consensus

Platform

Important

Commands

1.21 Pre-Release 1

Retrieved