What packages are needed for move actions?
rejomy opened this issue ยท 4 comments
Protocollib 5.0.0
I am writing a plugin that checks the height of the jump and if it is higher than allowed, drops the player to the ground.
What's the problem? Package for some reason is not called at the moment when the player touches the ground (this happens when jumping quickly a block higher, and from the block 1 more jump).
Here is the motion handler code: https://gist.github.com/Regomy/6ff0510745457420d6e6d6cf26ee7102 (here I check if the player is on the ground - I put his location)
Here's the jump checker code: https://gist.github.com/Regomy/7d7fa0db6e96c60a7b3c778cff8a2e5a (here I check the height)
Here is a video, where you can see that for some reason the height is not put in the right order: https://youtu.be/G7OZcfNFV9I
The POSITION packet is sent when the client moves but the head does not rotate.
The LOOK packet is sent when the client rotates their head but does not move.
The POSITION_LOOK packet is sent if the client moves and rotates their head.
Again, this is all perfectly documented at: https://wiki.vg/Protocol#Set_Player_Position
Where POSITION corresponds to "Set Player Position", LOOK corresponds to "Set Player Rotation", and POSITION_LOOK corresponds to "Set Player Position and Rotation".
The POSITION packet is sent when the client moves but the head does not rotate. The LOOK packet is sent when the client rotates their head but does not move. The POSITION_LOOK packet is sent if the client moves and rotates their head.
Again, this is all perfectly documented at: https://wiki.vg/Protocol#Set_Player_Position
Where POSITION corresponds to "Set Player Position", LOOK corresponds to "Set Player Rotation", and POSITION_LOOK corresponds to "Set Player Position and Rotation".
Thank you very much, but the problem remains, for some reason these packages are missing, or they are not called properly.
I understand that it's because the packets from my MoveProcessor just aren't sent when the player is pushed off the ground, and it turns out that it just can't record onGround. Where did I get this from? Because PlayerMoveEvent sees this movement calmly, but here it doesn't have time or something...
I'll clarify the situation and how I understood it. I want answers to current questions:
POSITION_LOOK does not work like separate packages POSITION and LOOK, question: POSITION_LOOK is a package when 1) the client moves the head and body at the same time? 2) Moves either the head or the body?