[PR #6798] [MERGED] A golem's or a fox's lead hangs where vanilla puts it #7102

Closed
opened 2026-11-03 06:33:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6798
Author: @MSedgeMC
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/leash-offsets


📝 Commits (1)

  • f8741e7 A golem's or a fox's lead hangs where vanilla puts it

📊 Changes

2 files changed (+56 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/mobs/leash.rs (+52 -0)
📝 tools/port_map/game-012.tsv (+4 -4)

📄 Description

Vanilla gives IronGolem, SnowGolem, CopperGolem and Fox their own getLeashOffset: 0.875, 0.75, 0.75 and 0.55 of the eye height respectively, and the copper golem's rope hangs on the mob's centre instead of bbWidth / 2 in front.

Horizon's mobs/leash.rs::leash_offset special-cased the llama, wolf, allay, camel and bee and fell back to Entity.getLeashOffset's default for everything else, so a lead on an iron golem hung at the full eye height (2.295 instead of 2.008 for a golem's 2.62 eyes) and a copper golem's hung in front of it.

Proven: on the build VM, cargo test -q -p horizon-client-lib --lib mobs::leash passes 13 tests including the new a_golem_or_a_fox_hangs_its_lead_where_vanilla_does; with the four new arms removed the same test fails on minecraft:iron_golem: height 2.2950000762939453 vs 2.008125066757202. cargo clippy -q -p horizon-client-lib --lib prints nothing and rustfmt --edition 2024 --check passes. The constants are from javap -p -c -constants on the 26.3 jar: IronGolem.getLeashOffset = new Vec3(0, 0.875f * getEyeHeight(), getBbWidth() * 0.4f), SnowGolem the same with 0.75f, CopperGolem with 0.75f and a zero z, Fox with 0.55f.

Not proven: I did not run the game, so I have not seen the rope drawn; the in-game check is tying a lead to an iron golem, a snow golem, a copper golem and a fox and looking at where the rope meets the mob.

Corrects the IronGolem.getLeashOffset, SnowGolem.getLeashOffset, CopperGolem.getLeashOffset and Fox.getLeashOffset rows of tools/port_map/game-012.tsv.


🔄 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/6798 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/leash-offsets` --- ### 📝 Commits (1) - [`f8741e7`](https://github.com/horizon-rust/horizon/commit/f8741e7eee2ef98c944998b8a5476ee220cc8e02) A golem's or a fox's lead hangs where vanilla puts it ### 📊 Changes **2 files changed** (+56 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/leash.rs` (+52 -0) 📝 `tools/port_map/game-012.tsv` (+4 -4) </details> ### 📄 Description Vanilla gives `IronGolem`, `SnowGolem`, `CopperGolem` and `Fox` their own `getLeashOffset`: 0.875, 0.75, 0.75 and 0.55 of the eye height respectively, and the copper golem's rope hangs on the mob's centre instead of `bbWidth / 2` in front. Horizon's `mobs/leash.rs::leash_offset` special-cased the llama, wolf, allay, camel and bee and fell back to `Entity.getLeashOffset`'s default for everything else, so a lead on an iron golem hung at the full eye height (2.295 instead of 2.008 for a golem's 2.62 eyes) and a copper golem's hung in front of it. **Proven:** on the build VM, `cargo test -q -p horizon-client-lib --lib mobs::leash` passes 13 tests including the new `a_golem_or_a_fox_hangs_its_lead_where_vanilla_does`; with the four new arms removed the same test fails on `minecraft:iron_golem: height 2.2950000762939453 vs 2.008125066757202`. `cargo clippy -q -p horizon-client-lib --lib` prints nothing and `rustfmt --edition 2024 --check` passes. The constants are from `javap -p -c -constants` on the 26.3 jar: `IronGolem.getLeashOffset` = `new Vec3(0, 0.875f * getEyeHeight(), getBbWidth() * 0.4f)`, `SnowGolem` the same with 0.75f, `CopperGolem` with 0.75f and a zero z, `Fox` with 0.55f. **Not proven:** I did not run the game, so I have not seen the rope drawn; the in-game check is tying a lead to an iron golem, a snow golem, a copper golem and a fox and looking at where the rope meets the mob. Corrects the `IronGolem.getLeashOffset`, `SnowGolem.getLeashOffset`, `CopperGolem.getLeashOffset` and `Fox.getLeashOffset` rows of `tools/port_map/game-012.tsv`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33:54 +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#7102
No description provided.