Hello,
This question isn't really about modding any minecraft behavior so much as understanding it. I've been trying to figure out this problem for weeks on end to no avail. I've searched endlessly through the 1.8 and 1.9 MCP decompiles and even attempted to model this server-side, but no solution presents itself.
I know that the player's velocity is supposedly the vector composed of their motionX, motionY, and motionZ. Looking through the EntityLivingBase#moveEntityWithHeading function, it seems that these are multiplied by the friction of the block the player is standing on when they move (predictably). This makes sense when these actually represent the components of the velocity vector, but what confuses me is that these same variables are also passed into the Entity#moveEntity function, where they are treated as displacement rather than as velocity (the derivative of displacement). And the Entity#moveFlying function (which, strangely enough, is called even when the player isn't flying or even in the air) also treats these values like displacement.
Also, I see no mention of the motionX, motionY, and motionZ variables being set to anything when a player initiates movement, only multiplied. What determines their initial values / when they're incremented? Does this relate to the moveStrafe and moveForward values set by MovementInputFromOptions? Where are these variables translated into actual positions?
I'm also confused because the player's server-side velocity X and Z components are often zero, even though the player is moving, and based on everything I've found, the server-side velocity mirrors the client-side velocity as represented by motionX,Y,Z.
But my main question is: what is the relationship between these variables and the actual move displacement of the player? Any help or guidance would be immensely appreciated.