[PR #1798] [MERGED] Sync mobs' aggressive and item-use flags so clients pose them right #3769

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

📋 Pull Request Information

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

Base: main ← Head: fix/mob-combat-poses


📝 Commits (2)

  • 41b7990 Sync mobs' aggressive and item-use flags so clients pose them right
  • 6ef8dee Merge origin/main into fix/mob-combat-poses

📊 Changes

7 files changed (+116 additions, -38 deletions)

View changed files

📝 crates/horizon-client/src/game/lan.rs (+22 -0)
📝 crates/horizon-client/src/game/mob_blocks.rs (+2 -2)
📝 crates/horizon-client/src/game/remote.rs (+24 -34)
📝 crates/horizon-client/src/game/remote_mob_data.rs (+56 -0)
📝 crates/horizon-client/src/mobs.rs (+5 -0)
📝 crates/horizon-client/src/mobs/anim.rs (+2 -2)
📝 crates/horizon-client/src/mobs/undead.rs (+5 -0)

📄 Description

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

What and why

Skeletons shoot arrows but never raised the bow: Mob.DATA_MOB_FLAGS_ID's aggressive bit and LivingEntity.DATA_LIVING_ENTITY_FLAGS were never sent to a client for mobs, so on the server thread and for LAN guests an attacking skeleton kept its arms down and the drawn bow never pulled. Now:

  • mob_meta emits entry 8 (using item, off hand) and entry 15's aggressive bit, with defaults so a flag going back to 0 is sent; a mob's use ticks count up on the client as LivingEntity.updatingUsingItem does, and the bow's pull animation follows them.
  • The same entries drive zombie arms, the vindicator's axe, the drowned's trident and the spellcasting pose, so the pillager's IS_CHARGING_CROSSBOW and the evoker's/illusioner's DATA_SPELL_CASTING_ID (entry 17, after Raider's 16) go with them.
  • A left-handed mob mirrors the pose and the held item (Mob.getMainArm), and a bow in the off hand counts for LivingEntity.isHolding.

Vanilla reference

Mob.setAggressive/DATA_MOB_FLAGS_ID, LivingEntity.startUsingItem/DATA_LIVING_ENTITY_FLAGS, AbstractSkeletonRenderer.getArmPose, SkeletonModel.setupAnim, RangedBowAttackGoal, HumanoidModel.BOW_AND_ARROW, IllagerRenderer.extractRenderState. Checked against the decompiled 26.3 sources.

Checked harnesses: lan, mob_ai, arrow, entity_model all pass; lan_e2e --check mobs passes (the skeleton hurts the guest) with screenshots; a live game on the server thread shows the mid-draw BOW_AND_ARROW pose.

Self-check

pr_ready (tools/pr_ready.py --quick on MacBookPro, against origin/main at 3a419877b, 21 s)

Check Result
Scope ✅ 7 files, +127 −49
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (5 s)
clippy ✅ (1 s)
tests: horizon-client ✅ 1228 passed (14 s)
doc tests ✅ 0 passed (1 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)

🤖 Generated with Devin (SWE-2).


🔄 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/1798 **Author:** [@socksprox](https://github.com/socksprox) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/mob-combat-poses` --- ### 📝 Commits (2) - [`41b7990`](https://github.com/horizon-rust/horizon/commit/41b799042acb262601e6a3e2695a5a3e68b4e618) Sync mobs' aggressive and item-use flags so clients pose them right - [`6ef8dee`](https://github.com/horizon-rust/horizon/commit/6ef8deedcaf562a68584ffc9759114f109837444) Merge origin/main into fix/mob-combat-poses ### 📊 Changes **7 files changed** (+116 additions, -38 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan.rs` (+22 -0) 📝 `crates/horizon-client/src/game/mob_blocks.rs` (+2 -2) 📝 `crates/horizon-client/src/game/remote.rs` (+24 -34) 📝 `crates/horizon-client/src/game/remote_mob_data.rs` (+56 -0) 📝 `crates/horizon-client/src/mobs.rs` (+5 -0) 📝 `crates/horizon-client/src/mobs/anim.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/undead.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by socksprox's AI agent (Devin, SWE-2), not by socksprox himself. ## What and why Skeletons shoot arrows but never raised the bow: `Mob.DATA_MOB_FLAGS_ID`'s aggressive bit and `LivingEntity.DATA_LIVING_ENTITY_FLAGS` were never sent to a client for mobs, so on the server thread and for LAN guests an attacking skeleton kept its arms down and the drawn bow never pulled. Now: - `mob_meta` emits entry 8 (using item, off hand) and entry 15's aggressive bit, with defaults so a flag going back to 0 is sent; a mob's use ticks count up on the client as `LivingEntity.updatingUsingItem` does, and the bow's pull animation follows them. - The same entries drive zombie arms, the vindicator's axe, the drowned's trident and the spellcasting pose, so the pillager's `IS_CHARGING_CROSSBOW` and the evoker's/illusioner's `DATA_SPELL_CASTING_ID` (entry 17, after Raider's 16) go with them. - A left-handed mob mirrors the pose and the held item (`Mob.getMainArm`), and a bow in the off hand counts for `LivingEntity.isHolding`. ## Vanilla reference `Mob.setAggressive`/`DATA_MOB_FLAGS_ID`, `LivingEntity.startUsingItem`/`DATA_LIVING_ENTITY_FLAGS`, `AbstractSkeletonRenderer.getArmPose`, `SkeletonModel.setupAnim`, `RangedBowAttackGoal`, `HumanoidModel.BOW_AND_ARROW`, `IllagerRenderer.extractRenderState`. Checked against the decompiled 26.3 sources. Checked harnesses: `lan`, `mob_ai`, `arrow`, `entity_model` all pass; `lan_e2e --check mobs` passes (the skeleton hurts the guest) with screenshots; a live game on the server thread shows the mid-draw `BOW_AND_ARROW` pose. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on MacBookPro, against origin/main at 3a419877b, 21 s) | Check | Result | | --- | --- | | Scope | ✅ 7 files, +127 −49 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 s) | | tests: horizon-client | ✅ 1228 passed (14 s) | | doc tests | ✅ 0 passed (1 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) | 🤖 Generated with [Devin](https://devin.ai) (SWE-2). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:11 +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#3769
No description provided.