From d83b3e18bc98d93c20fd47ce5b85367a324f7900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Dr=C3=A4ger?= <20014538+sdraeger@users.noreply.github.com> Date: Sat, 24 Oct 2026 13:21:23 -0700 Subject: [PATCH 1/2] Keep mob pitch on /tp --- crates/horizon-client/src/game/commands.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/commands.rs b/crates/horizon-client/src/game/commands.rs index a229cbdc9..bab925c4f 100644 --- a/crates/horizon-client/src/game/commands.rs +++ b/crates/horizon-client/src/game/commands.rs @@ -1098,9 +1098,11 @@ impl Game<'_> { if let Some(m) = self.mobs.iter_mut().find(|m| m.id == id) { m.position = v; m.previous = v; - if let Some([yaw, _]) = rotation { + if let Some([yaw, pitch]) = rotation { m.yaw = yaw; m.body_yaw = yaw; + // Entity.setXRot clamps to -90..90. + m.head_pitch = pitch.clamp(-90.0, 90.0); } } } From f23db61ecf17e76ba8f3a43d0d995afe3ab641ff Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 09:35:46 +0100 Subject: [PATCH 2/2] /tp: a mob's head turns and its old rotation follows, as teleportSetPosition does Entity.teleportSetPosition calls setYRot, setYHeadRot and setXRot, then setOldPosAndRot: the head faces the new yaw and yRotO/xRotO match, so a teleported mob doesn't sweep from its old pitch on the next frame. Co-Authored-By: Claude Opus 5.5 --- crates/horizon-client/src/game/commands.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game/commands.rs b/crates/horizon-client/src/game/commands.rs index bab925c4f..d41543d90 100644 --- a/crates/horizon-client/src/game/commands.rs +++ b/crates/horizon-client/src/game/commands.rs @@ -1098,11 +1098,15 @@ impl Game<'_> { if let Some(m) = self.mobs.iter_mut().find(|m| m.id == id) { m.position = v; m.previous = v; + // Entity.teleportSetPosition: setYRot, setYHeadRot, setXRot + // (clamped to -90..90), then setOldRot. if let Some([yaw, pitch]) = rotation { m.yaw = yaw; m.body_yaw = yaw; - // Entity.setXRot clamps to -90..90. + m.head_yaw = yaw; m.head_pitch = pitch.clamp(-90.0, 90.0); + m.previous_yaw = m.yaw; + m.previous_head_pitch = m.head_pitch; } } }