Skip to main content

Player Movement

This packet contains pressed movement keys and the player's look direction. It does not contain any position coordinates.

The client sends this packet to the server once every tick. If the client's framerate drops below the tickrate, at most one packet is sent per frame.

  • ID: 0x1E (30)
  • Size: 8 bytes
  • LZ4 Compressed: Yes
  • State: Playing
  • Bound To: Client -> Server

Structure

OffsetField NameField TypeNotes
0x00Tickbe u32The current tick.
0x04Keysu8 bitfieldBitfield of which movement keys are pressed. See Keys bitfield.
0x05Directionu8

The horizontal direction, relative to the player's yaw, the player is walking in or has last walked in. When the player stops walking, this value is not updated.

Strafing right starts at 0 and increases when changing the direction counter-clockwise (to the left). When using the keyboard, only distinct increments of 32 can be achieved, but the server supports any value between 0 and 255.
0x06Yawu8The player's horizontal look rotation. A yaw of 0 means the player is looking into the positive Y direction. Rotating counter-clockwise (to the left) increases the yaw. After reaching 255, the yaw overflows back to 0.
0x07Pitchu8The player's vertical look rotation. A pitch of 0 means the player is looking straight down (into the negative Z direction). Looking straight up yields a pitch of 128.

Keys bitfield

Contains information about which movement keys are pressed. All bits are always low while the player's character is seated or tumbling.

BitsField nameNotes
7UnusedGuaranteed to not be used. Always low.
6
5
4Aim

High when the player is aiming with a tool. This value is set using

Tool:setMovementSlowDown(boolean)

and read using

Character:isAiming()

.

3Sprint

High when the player is sprinting while moving horizontally. Low in all other cases, including when the player is holding the Sprint button while standing still.

Always lags one tick behind when starting a sprint from standstill. The sprint bitflag also continues to stay high for one more tick after the player has stopped moving horizontally.

2HorizontalHigh when any of the Move Forward, Move Backward, Stafe Left or Strafe Right keys are pressed.
1CrawlHigh when the player is holding the Crawl (crouch) keybind. This is not connected to the actual crawl state of the player's character. If the character is crawling and unable to stand up, the value can be either high or low depending on wether the player is holding the Crawl key or not.
0JumpHigh when the player is holding the Jump button. The player's character does not have to be on the ground.