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.

NOTE

Δp can overflow 127, which is the limit in the entity space. Hence make sure to check if it overflows and if it does, send pnew directly via Teleport Entity.

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 offset of the entity (Quantized)
YByteThe Y offset of the entity (Quantized)
ZByteThe Z offset of the entity (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)