[PR #1675] [MERGED] /tp: keep the pitch for mobs #3680

Closed
opened 2026-11-03 04:11:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1675
Author: @sdraeger
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/tp-mob-pitch


📝 Commits (2)

  • d83b3e1 Keep mob pitch on /tp
  • f23db61 /tp: a mob's head turns and its old rotation follows, as teleportSetPosition does

📊 Changes

1 file changed (+7 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/game/commands.rs (+7 -1)

📄 Description

🤖 Opened by Simon's AI agent (Claude Code), not by Simon himself.

What and why

Fixes #1603. teleport_to dropped the second rotation value for Target::Mob.

 Target::Mob(id) =>
-  if let Some([yaw, _]) = rotation
+  if let Some([yaw, pitch]) = rotation
     m.yaw = yaw; m.body_yaw = yaw
+    m.head_pitch = pitch.clamp(-90, 90)   # Entity.setXRot

Mob::head_pitch is the field documented as Entity.xRot.

Evidence

/summon bat ~ ~3 ~ {Tags:["t"],NoAI:1b}, then /tp @e[tag=t,limit=1] ~ ~ ~ 30 <pitch> and /data get … Rotation:

pitch before after
40 [30.0f, 0.0f] [30.0f, 40.0f]
120 not run [30.0f, 90.0f]

python3 tools/parity.py command_exec: PASS (its corpus has no rotated tp of a mob; a corpus line for it would be a good follow-up).

Vanilla reference

TeleportCommand.performTeleport (wraps both angles, calls Entity.teleportTo), Entity.setXRot (clamps to -90..90), read with javap on the 26.3 client jar. Harness: command_exec.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on Simons-MacBook-Pro, against upstream/main at fe128948b, 1 min 25 s)

Check Result
Scope ✅ 1 files, +3 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (3 s)
clippy ✅ (27 s)
tests: horizon-client ✅ 1199 passed (53 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Merge danger

Door: two-way. Blast radius: mobs teleported with an explicit or relative pitch. Mobs with AI set their own pitch on the next tick, as in vanilla.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/1675 **Author:** [@sdraeger](https://github.com/sdraeger) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/tp-mob-pitch` --- ### 📝 Commits (2) - [`d83b3e1`](https://github.com/horizon-rust/horizon/commit/d83b3e18bc98d93c20fd47ce5b85367a324f7900) Keep mob pitch on /tp - [`f23db61`](https://github.com/horizon-rust/horizon/commit/f23db61ecf17e76ba8f3a43d0d995afe3ab641ff) /tp: a mob's head turns and its old rotation follows, as teleportSetPosition does ### 📊 Changes **1 file changed** (+7 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands.rs` (+7 -1) </details> ### 📄 Description > 🤖 Opened by Simon's AI agent (Claude Code), not by Simon himself. ## What and why Fixes #1603. `teleport_to` dropped the second rotation value for `Target::Mob`. ```diff Target::Mob(id) => - if let Some([yaw, _]) = rotation + if let Some([yaw, pitch]) = rotation m.yaw = yaw; m.body_yaw = yaw + m.head_pitch = pitch.clamp(-90, 90) # Entity.setXRot ``` `Mob::head_pitch` is the field documented as `Entity.xRot`. ## Evidence `/summon bat ~ ~3 ~ {Tags:["t"],NoAI:1b}`, then `/tp @e[tag=t,limit=1] ~ ~ ~ 30 <pitch>` and `/data get … Rotation`: | pitch | before | after | |---|---|---| | 40 | `[30.0f, 0.0f]` | `[30.0f, 40.0f]` | | 120 | not run | `[30.0f, 90.0f]` | `python3 tools/parity.py command_exec`: PASS (its corpus has no rotated `tp` of a mob; a corpus line for it would be a good follow-up). ## Vanilla reference `TeleportCommand.performTeleport` (wraps both angles, calls `Entity.teleportTo`), `Entity.setXRot` (clamps to -90..90), read with `javap` on the 26.3 client jar. Harness: `command_exec`. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Simons-MacBook-Pro, against upstream/main at fe128948b, 1 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +3 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (3 s) | | clippy | ✅ (27 s) | | tests: horizon-client | ✅ 1199 passed (53 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ## Merge danger **Door:** two-way. **Blast radius:** mobs teleported with an explicit or relative pitch. Mobs with AI set their own pitch on the next tick, as in vanilla. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:11:23 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3680
No description provided.