[PR #4868] [MERGED] Fix unclickable fake player NPCs (scaled hitboxes, dead mobs, interaction range) #5900

Closed
opened 2026-11-03 05:15:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4868
Author: @socksprox
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/fake-player-hitbox


📝 Commits (9)

  • 3d5aed2 Scale fake player hitboxes with minecraft:scale; pick !removed entities
  • d0076a5 Merge main
  • ed17fee fmt: wrap the interaction_range signature
  • f6e255e Merge main: keep both the scaled-box and sulfur cube fuse tests
  • 0feb6f9 Unscale the default rider attachment before applying model scale
  • c37ca8b Preserve guest interaction ranges
  • 46329b3 Keep the scaled seat of a scaled non-avatar vehicle
  • a4ecd4e Bound entity picks by the unfiltered block hit
  • d27432c Bound the painting and mob picks in attack() by the unfiltered block hit

📊 Changes

21 files changed (+128 additions, -47 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+39 -22)
📝 crates/horizon-client/src/game/agent.rs (+3 -1)
📝 crates/horizon-client/src/game/armor_stands.rs (+1 -1)
📝 crates/horizon-client/src/game/boats.rs (+1 -1)
📝 crates/horizon-client/src/game/creatures.rs (+1 -1)
📝 crates/horizon-client/src/game/cushions.rs (+1 -1)
📝 crates/horizon-client/src/game/deflect.rs (+3 -3)
📝 crates/horizon-client/src/game/dragon.rs (+1 -1)
📝 crates/horizon-client/src/game/frames.rs (+2 -2)
📝 crates/horizon-client/src/game/hand.rs (+6 -1)
📝 crates/horizon-client/src/game/interactions.rs (+1 -1)
📝 crates/horizon-client/src/game/lan_actions.rs (+12 -0)
📝 crates/horizon-client/src/game/lan_pvp.rs (+1 -1)
📝 crates/horizon-client/src/game/minecarts.rs (+1 -1)
📝 crates/horizon-client/src/game/paintings.rs (+1 -1)
📝 crates/horizon-client/src/game/pick_entity.rs (+1 -1)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+23 -0)
📝 crates/horizon-client/src/game/remote_vehicles.rs (+2 -2)
📝 crates/horizon-client/src/game/trading.rs (+1 -1)
📝 crates/horizon-client/src/mobs/living.rs (+9 -2)

...and 1 more files

📄 Description

🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally.

Summary

Closes #4858. On servers that use fake player entities for lobby NPCs (gommehd.net's giant SMP/BedWars/CityBuild figures), right-clicking the NPC did nothing; vanilla moves you to the game server. Three parity divergences against the decompiled 26.3 sources:

  • LivingEntity.getDimensions(pose) = getDefaultDimensions(pose).scale(getScale()) — minecraft:scale grows the hitbox with the model. Mob::awake_dims_in hardcoded avatar_pose.dimensions(1.0), so a giant fake player's clickbox stayed 0.6×1.8 at its feet while its model filled the screen.
  • EntitySelector.CAN_BE_PICKED = isPickable = !isRemoved() — no alive check. mob_hit skipped !m.alive(), so a health-0 fake player still rendered but couldn't be clicked (or listed by entities). Now m.removed.
  • GameRenderer.pick uses entityInteractionRange()/blockInteractionRange() attributes — every pick raycast hardcoded 3.0/4.5 (survival) / 5.0 (creative). Both ranges are now refreshed per tick from the player's attributes into entity_reach/block_reach and used by all entity picks (mob_hit, interaction_hit, remote_object_hit, boats/carts/frames/paintings/armor stands/cushions/dragon/deflect, LAN pvp/trading) and the block pick (max(block, entity) like GameRenderer.pick).

interaction_range needed pub(super) so tick can refresh the cache — the &mut attribute read can't live in the &self pick helpers.

Test plan

  • New remote_mob_data::tests::a_scaled_fake_player_gets_a_scaled_box (player + mannequin dims scale with model_scale).
  • cargo test -p horizon-client --lib --bins: 1198 passed, 0 failed. fmt + clippy clean.
  • Verified live on gommehd.net before the fix: the giant SMP fake player rendered but looking_at.entity was null and right-click did nothing.
  • tools/pr_ready.py: public tree + Python tests pass; parity harnesses running locally (~100 triggered by the lib change).

🤖 Generated with Devin


🔄 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/4868 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/fake-player-hitbox` --- ### 📝 Commits (9) - [`3d5aed2`](https://github.com/horizon-rust/horizon/commit/3d5aed2b2070792b65f86fdc103324bec019c04f) Scale fake player hitboxes with minecraft:scale; pick !removed entities - [`d0076a5`](https://github.com/horizon-rust/horizon/commit/d0076a511970547da356d7b318b77e19c1300cd9) Merge main - [`ed17fee`](https://github.com/horizon-rust/horizon/commit/ed17feee57bd9099fa0d3e07bcf785ed10de5b5c) fmt: wrap the interaction_range signature - [`f6e255e`](https://github.com/horizon-rust/horizon/commit/f6e255ef2b9d88bfd8043b4c5dc342d5ca3846e5) Merge main: keep both the scaled-box and sulfur cube fuse tests - [`0feb6f9`](https://github.com/horizon-rust/horizon/commit/0feb6f945e963fd10ceaa530430c4d579189a32b) Unscale the default rider attachment before applying model scale - [`c37ca8b`](https://github.com/horizon-rust/horizon/commit/c37ca8bbc30ca545695aee290a814b3207e819bd) Preserve guest interaction ranges - [`46329b3`](https://github.com/horizon-rust/horizon/commit/46329b3cb6ded667ca408464b5b3e243f9778767) Keep the scaled seat of a scaled non-avatar vehicle - [`a4ecd4e`](https://github.com/horizon-rust/horizon/commit/a4ecd4ebb6ae7ff23842d4b48d2d9af5590fdff8) Bound entity picks by the unfiltered block hit - [`d27432c`](https://github.com/horizon-rust/horizon/commit/d27432c461da623577cfffa985b185602544d77c) Bound the painting and mob picks in attack() by the unfiltered block hit ### 📊 Changes **21 files changed** (+128 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+39 -22) 📝 `crates/horizon-client/src/game/agent.rs` (+3 -1) 📝 `crates/horizon-client/src/game/armor_stands.rs` (+1 -1) 📝 `crates/horizon-client/src/game/boats.rs` (+1 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+1 -1) 📝 `crates/horizon-client/src/game/cushions.rs` (+1 -1) 📝 `crates/horizon-client/src/game/deflect.rs` (+3 -3) 📝 `crates/horizon-client/src/game/dragon.rs` (+1 -1) 📝 `crates/horizon-client/src/game/frames.rs` (+2 -2) 📝 `crates/horizon-client/src/game/hand.rs` (+6 -1) 📝 `crates/horizon-client/src/game/interactions.rs` (+1 -1) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+12 -0) 📝 `crates/horizon-client/src/game/lan_pvp.rs` (+1 -1) 📝 `crates/horizon-client/src/game/minecarts.rs` (+1 -1) 📝 `crates/horizon-client/src/game/paintings.rs` (+1 -1) 📝 `crates/horizon-client/src/game/pick_entity.rs` (+1 -1) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+23 -0) 📝 `crates/horizon-client/src/game/remote_vehicles.rs` (+2 -2) 📝 `crates/horizon-client/src/game/trading.rs` (+1 -1) 📝 `crates/horizon-client/src/mobs/living.rs` (+9 -2) _...and 1 more files_ </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin, SWE-2 High), not by socksprox personally. ## Summary Closes #4858. On servers that use fake player entities for lobby NPCs (gommehd.net's giant SMP/BedWars/CityBuild figures), right-clicking the NPC did nothing; vanilla moves you to the game server. Three parity divergences against the decompiled 26.3 sources: - **`LivingEntity.getDimensions(pose)` = `getDefaultDimensions(pose).scale(getScale())`** — `minecraft:scale` grows the hitbox with the model. `Mob::awake_dims_in` hardcoded `avatar_pose.dimensions(1.0)`, so a giant fake player's clickbox stayed 0.6×1.8 at its feet while its model filled the screen. - **`EntitySelector.CAN_BE_PICKED` = `isPickable` = `!isRemoved()`** — no alive check. `mob_hit` skipped `!m.alive()`, so a health-0 fake player still rendered but couldn't be clicked (or listed by `entities`). Now `m.removed`. - **`GameRenderer.pick` uses `entityInteractionRange()`/`blockInteractionRange()` attributes** — every pick raycast hardcoded 3.0/4.5 (survival) / 5.0 (creative). Both ranges are now refreshed per tick from the player's attributes into `entity_reach`/`block_reach` and used by all entity picks (`mob_hit`, `interaction_hit`, `remote_object_hit`, boats/carts/frames/paintings/armor stands/cushions/dragon/deflect, LAN pvp/trading) and the block pick (`max(block, entity)` like `GameRenderer.pick`). `interaction_range` needed `pub(super)` so `tick` can refresh the cache — the `&mut` attribute read can't live in the `&self` pick helpers. ## Test plan - New `remote_mob_data::tests::a_scaled_fake_player_gets_a_scaled_box` (player + mannequin dims scale with `model_scale`). - `cargo test -p horizon-client --lib --bins`: 1198 passed, 0 failed. fmt + clippy clean. - Verified live on gommehd.net before the fix: the giant SMP fake player rendered but `looking_at.entity` was `null` and right-click did nothing. - `tools/pr_ready.py`: public tree + Python tests pass; parity harnesses running locally (~100 triggered by the lib change). 🤖 Generated with [Devin](https://devin.ai) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:15:48 +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#5900
No description provided.