Skip to content

Entity Position and Rotation

Packet IDDirectionMojang NameMCP Name
0x21ClientboundMoveEntityPacket.PosRotPacket33RelEntityMoveLook

Clientbound

Sent to the client to set an entity's position relative to the clients previous position. Usually sent when an entity has moved less than 4 blocks. Position and rotation data is in entity space and thus quantized.

More specifically:

Δp=(pnewpold)32

where pnew and pold refer to the X, Y and Z positions received by Player Position and Player Position and Rotation packets. You should set Δp in Entity Position and Rotation as well as Entity Position packets.

For Yaw and Pitch:

r=r256/360

Where r refers to Yaw or Pitch received by Player Rotation and Player Position and Rotation packets. r should be set in Entity Position and Rotation as well as Entity Rotation packets.

FieldTypeDescription
Entity IDIntegerThe ID of the entity that should be moved
XByteThe X position of the player (Quantized)
YByteThe Y position of the player (Quantized)
ZByteThe Z position of the player (Quantized)
YawByteRotation on the X Axis (Quantized)
PitchByteRotation on the Y Axis (Quantized)

Example Packets

Clientbound

FieldValue
Entity ID1298
X5 (0.15)
Y2 (0.06)
Z15 (0.46)
Yaw16 (22.58)
Pitch9 (12.70)