I am REALLY confused about X/Y/Z delta movement blocks

Started by Ulmakamu Kepler on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am REALLY confused about X/Y/Z delta movement blocks

I am trying to use delta movement blocks to find out if an entity is moving or not. I've been looking through the internet for almost 2 days now and only thing I could have found was that you may be able to say when an entity moves by seeing its velocity values and velocity values are renamed to delta movements. But its always shows 0 when Im on the ground even if I'm moving and only changes when I jump.

This is really necessary for my mod so thanks a lot if you can help me. Thanks a lot anyway if you read this but couldn't found a solution.

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
X and z delta movement…
Sat, 10/05/2024 - 14:01

X and z delta movement values will only change when moving across the world. Compared to y delta movement values which will only change when you jump and fall or fly. If your moving parallel to any blocks then only the x or z will change. If you move diagonally both x and z should change.

Your procedure to output the values must be wrong as your only outputting the y delta movement.

If your trying to fine if an entity is moving or not:

If [x delta movement] = 0 [and] [z delta movement] = 0 [and] [y delta movement] = 0

    etc....

Only use y delta if you care if the entity is moving up or down, which you may only want if its a flying entity.

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
One more note about delta…
Sat, 10/05/2024 - 14:04

One more note about delta movement, it is really weird with players, as a player's delta movement is one of the few things in minecraft that is not synchronized with both client side and server side at all.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oooh I guess the reason was…
Sat, 10/05/2024 - 14:46

Oooh I guess the reason was that I used to do this on a "On player tick update" procedure block and maybe that was it didn't sync between the server and stuff. Let me try it and I will update with the outcome.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok so that didn't work out…
Sat, 10/05/2024 - 15:16

Ok so that didn't work out. I will send some photos I took trying to debug this. First one is the first procedure I tried to use. Second one is the newest one I did a minute ago after typing the response above. Third photo is me running to see how variables would change but both of the procedures give the same results except when I jump AND run at the same time for some reason. Sorry for taking your time I just want to get to the bottom of this. Thanks everyone that responded to this post and will in the future.""""

""

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Well I tried it and I dont…
Sat, 10/05/2024 - 19:56

Well I tried it and I dont really know. I dont know how it is the "delta movement", delta would imply its how the entitiy's movement changes between two points, so basically acceleration. Idk if its the change in movement between ticks or what. If I had to guess what -0.08 was its most likely the gravity.

Idk if its just to do with how minecraft processes player data but x y z delta movements work fine on entities. Try outputting an entity's delta movement and it comes out as expected.

Joined Oct 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yep, I just tried it on a…
Sun, 10/06/2024 - 04:56

Yep, I just tried it on a pig and it works as expected(except when I'm riding him). So I assume that players delta movement works very different from other entitites. I will try to find out if players are moving by checkin players coordinates and seeing if they are different tick before. Thank you a lot for taking your time with this. Have a wonderfull day.