[PR #4731] [MERGED] Draw arrows and bee stingers stuck in a player's body #5810

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4731
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/F-stuck-arrows


📝 Commits (1)

  • 7a09947 Draw arrows and bee stingers stuck in a player's body

📊 Changes

15 files changed (+443 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/combat.rs (+83 -0)
📝 crates/horizon-client/src/game/creatures.rs (+28 -5)
📝 crates/horizon-client/src/game/lan.rs (+6 -0)
📝 crates/horizon-client/src/game/lan_actions.rs (+20 -0)
📝 crates/horizon-client/src/game/lan_mobs.rs (+1 -0)
📝 crates/horizon-client/src/game/perspective.rs (+61 -0)
📝 crates/horizon-client/src/game/remote.rs (+17 -0)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+17 -0)
📝 crates/horizon-client/src/lan/guest.rs (+3 -0)
📝 crates/horizon-client/src/lan/hub.rs (+31 -0)
📝 crates/horizon-client/src/mobs.rs (+13 -0)
📝 crates/horizon-client/src/mobs/bee.rs (+5 -11)
📝 crates/horizon-client/src/mobs/render.rs (+153 -0)
📝 crates/horizon-client/tests/lan_bot.rs (+1 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3519

What and why

Arrows and bee stingers stuck in a player's body were never drawn: Horizon kept no count. Now the server keeps LivingEntity.DATA_ARROW_COUNT_ID / DATA_STINGER_COUNT_ID (entity data 12 and 13) for players on the server-thread path (host and guests), syncs them through the LAN entity tracker, and the client draws them from the synced counts.

Rows:

  • StuckInBodyLayer.submit: mobs::render::stuck_in_body picks a body part, a cube and a point with a random source seeded by the entity id, in vanilla's draw order, for ArrowLayer (in cube) and BeeStingerLayer (on surface).
  • StuckInBodyLayer.submitStuckItem: yaw/xRot from the point's direction (atan2), then the arrow / stinger model.

Also: the increment on a hurting non-piercing arrow hit (AbstractArrow.onHitEntity), on a bee sting that hurt (Bee.doHurtTarget, new MobEvent::StingPlayer, poison after the stinger), and LivingEntity.tick's removeArrowTime / removeStingerTime decay (20 * (30 - count)). Mobs keep no count: only the avatar renderer has the layers.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

StuckInBodyLayer.submit/submitStuckItem/snapToFace, ArrowLayer, BeeStingerLayer, PlayerModel.getRandomBodyPart, ModelPart.getRandomCube, LivingEntity.tick (arrow/stinger decay), AbstractArrow.onHitEntity, Bee.doHurtTarget.

Self-check

cargo +stable fmt --all, clippy -p horizon-client --all-targets -D warnings, unit tests: Stuck timers, cube_bounds, snap_to_face, the synched meta, the client reading counts. Not run locally (machine limits): parity harnesses (CI).

🤖 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/4731 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/F-stuck-arrows` --- ### 📝 Commits (1) - [`7a09947`](https://github.com/horizon-rust/horizon/commit/7a09947e4610cd3bf8e99c84751a5c660675bd8d) Draw arrows and bee stingers stuck in a player's body ### 📊 Changes **15 files changed** (+443 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/combat.rs` (+83 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+28 -5) 📝 `crates/horizon-client/src/game/lan.rs` (+6 -0) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+20 -0) 📝 `crates/horizon-client/src/game/lan_mobs.rs` (+1 -0) 📝 `crates/horizon-client/src/game/perspective.rs` (+61 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+17 -0) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+17 -0) 📝 `crates/horizon-client/src/lan/guest.rs` (+3 -0) 📝 `crates/horizon-client/src/lan/hub.rs` (+31 -0) 📝 `crates/horizon-client/src/mobs.rs` (+13 -0) 📝 `crates/horizon-client/src/mobs/bee.rs` (+5 -11) 📝 `crates/horizon-client/src/mobs/render.rs` (+153 -0) 📝 `crates/horizon-client/tests/lan_bot.rs` (+1 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3519 ## What and why Arrows and bee stingers stuck in a player's body were never drawn: Horizon kept no count. Now the server keeps `LivingEntity.DATA_ARROW_COUNT_ID` / `DATA_STINGER_COUNT_ID` (entity data 12 and 13) for players on the server-thread path (host and guests), syncs them through the LAN entity tracker, and the client draws them from the synced counts. Rows: - `StuckInBodyLayer.submit`: `mobs::render::stuck_in_body` picks a body part, a cube and a point with a random source seeded by the entity id, in vanilla's draw order, for `ArrowLayer` (in cube) and `BeeStingerLayer` (on surface). - `StuckInBodyLayer.submitStuckItem`: yaw/xRot from the point's direction (`atan2`), then the arrow / stinger model. Also: the increment on a hurting non-piercing arrow hit (`AbstractArrow.onHitEntity`), on a bee sting that hurt (`Bee.doHurtTarget`, new `MobEvent::StingPlayer`, poison after the stinger), and `LivingEntity.tick`'s `removeArrowTime` / `removeStingerTime` decay (`20 * (30 - count)`). Mobs keep no count: only the avatar renderer has the layers. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `StuckInBodyLayer.submit/submitStuckItem/snapToFace`, `ArrowLayer`, `BeeStingerLayer`, `PlayerModel.getRandomBodyPart`, `ModelPart.getRandomCube`, `LivingEntity.tick` (arrow/stinger decay), `AbstractArrow.onHitEntity`, `Bee.doHurtTarget`. ## Self-check `cargo +stable fmt --all`, `clippy -p horizon-client --all-targets -D warnings`, unit tests: `Stuck` timers, `cube_bounds`, `snap_to_face`, the synched meta, the client reading counts. Not run locally (machine limits): parity harnesses (CI). 🤖 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 05:15:10 +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#5810
No description provided.