Skip to content

Commit 2b65c14

Browse files
domdomeggdomdomegg
andauthored
Convert yaw/pitch in sync_entity_position handler (#3896)
The 1.21.3+ sync_entity_position packet replaced separate look/move packets but the new handler set entity.yaw/pitch directly from packet fields, skipping the notchian → radians conversion the older handlers in this file apply via fromNotchianYaw/fromNotchianYawByte. Tracked entities (other players, mobs) ended up with raw protocol values in their public yaw/pitch fields, so consumers like prismarine-viewer interpreting them as radians produced wildly wrong rotations on every move event. The bug was masked when entities also emitted entity_look packets (which set yaw correctly via the byte helper), so it was visible mainly during y-only motion (jumping) where no look packet fires. Co-authored-by: domdomegg <domdomegg+anthropic@gmail.com>
1 parent 61fbd3a commit 2b65c14

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/plugins/entities.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ function inject (bot) {
349349
const entity = fetchEntity(packet.entityId)
350350
entity.position.set(packet.x, packet.y, packet.z)
351351
entity.velocity.set(packet.dx, packet.dy, packet.dz)
352-
entity.yaw = packet.yaw
353-
entity.pitch = packet.pitch
352+
entity.yaw = conv.fromNotchianYaw(packet.yaw)
353+
entity.pitch = conv.fromNotchianPitch(packet.pitch)
354354
bot.emit('entityMoved', entity)
355355
})
356356

0 commit comments

Comments
 (0)