Topic category: Help with Minecraft modding (Java Edition)
PLEASE, READ EVERYTHING.
I want to clarify a common misunderstanding: delta movement is not itself a “speed check,” but it can be used to calculate speed. What delta movement actually represents is a 3D vector describing how much the entity moves on each axis (X, Y, Z) during the current game tick.
This means:
- The sign of each component (positive or negative) only indicates direction, not speed.
-
A negative delta value does not mean “no movement” — it simply means the entity is moving toward negative coordinates.
During my tests, I noticed something important:
If you look only at the raw X, Y, or Z values, they can be small or negative, and therefore they are not reliable alone to determine whether the mob is “walking” or “running.”
This is why checking “if delta X > 0” or “if delta Z > 0” is not a valid method — movement can happen in the negative direction as well.
But:
Even when the components are negative, the speed can still be obtained correctly by calculating the magnitude of the vector:
speed = sqrt( dx*dx + dy*dy + dz*dz )
This gives a positive speed value, regardless of direction.
So delta movement does not fail for speed detection —
what fails is trying to check speed by inspecting the individual components separately.
What delta movement is useful for:
- Detecting the direction the entity is moving (positive or negative axis).
- Determining if the entity is moving at all (speed > 0).
- Calculating actual speed using the vector’s magnitude.
- Predicting the next position of the entity (current position + delta).
Why delta Y sometimes “works” for people
When a mob jumps or falls, delta Y is large enough (positive or negative) to trigger simple conditionals like:
if deltaMovement.y > 0
But X and Z often have very tiny values, both positive or negative, so checks like:
if deltaMovement.x > 0
fail, because the mob may be moving but toward negative X.
Conclusion
Delta movement does not fail as a speed detection method, it only fails if someone tries to detect movement by checking individual components instead of calculating the vector’s magnitude.
That was all, i hope that this post help someone and i'll update this if i discover something new.
Post made by: KrathK
Last Update: 13/09/25
Nice tutorial!