[GH-ISSUE #1603] /tp drops the pitch for mobs #499

Closed
opened 2026-11-02 15:39:33 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @sdraeger on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1603

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

/tp <mob> <pos> <yaw> <pitch> sets the yaw and ignores the pitch.

/summon bat ~ ~3 ~ {Tags:["t"],NoAI:1b}
/tp @e[tag=t,limit=1] ~ ~ ~ 30 40
/data get entity @e[tag=t,limit=1] Rotation

Horizon: [30.0f, 0.0f]. Vanilla: [30.0f, 40.0f].

teleport_to (game/commands.rs) writes yaw and body_yaw for Target::Mob and drops the second rotation value. Vanilla's TeleportCommand.performTeleport passes both to Entity.teleportTo, and Entity.setXRot clamps the pitch to -90..90 (checked with javap on the 26.3 jar). The player branch of teleport_to already sets and clamps it.

This also means a mob camera (/spectate) can never look up or down after a teleport.

A PR with the fix follows.

Originally created by @sdraeger on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1603 > 🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself. `/tp <mob> <pos> <yaw> <pitch>` sets the yaw and ignores the pitch. ```text /summon bat ~ ~3 ~ {Tags:["t"],NoAI:1b} /tp @e[tag=t,limit=1] ~ ~ ~ 30 40 /data get entity @e[tag=t,limit=1] Rotation ``` Horizon: `[30.0f, 0.0f]`. Vanilla: `[30.0f, 40.0f]`. `teleport_to` (`game/commands.rs`) writes `yaw` and `body_yaw` for `Target::Mob` and drops the second rotation value. Vanilla's `TeleportCommand.performTeleport` passes both to `Entity.teleportTo`, and `Entity.setXRot` clamps the pitch to -90..90 (checked with `javap` on the 26.3 jar). The player branch of `teleport_to` already sets and clamps it. This also means a mob camera (`/spectate`) can never look up or down after a teleport. A PR with the fix follows.
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#499
No description provided.