[PR #3721] [MERGED] Skeletons: a path out of the shade stops at the first node the sky sees #5169

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

📋 Pull Request Information

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

Base: main ← Head: fix/skeleton-path-stops-in-shade


📝 Commits (10+)

  • 5100563 Skeletons: a path out of the shade stops at the first node the sky sees
  • 183e772 Merge remote-tracking branch 'origin/main' into upd-3721
  • 4ef3c1f Merge origin/main into fix/skeleton-path-stops-in-shade
  • 8f7c959 Navigation: trimPath runs in moveTo, before the node count check
  • 735cdab Merge origin/main into fix/skeleton-path-stops-in-shade
  • f1eedfc Merge remote-tracking branch 'origin/main' into upd-3721
  • 9ee6b29 Merge remote-tracking branch 'origin/main' into upd-3721
  • 08e7c00 Merge remote-tracking branch 'origin/main' into upd-3721
  • 3bff52e Merge remote-tracking branch 'origin/main' into fix-3721
  • fb83211 Pass the world to nav_move_to_path in the callers main added

📊 Changes

11 files changed (+57 additions, -28 deletions)

View changed files

📝 crates/horizon-client/src/mobs/animal_brain.rs (+2 -2)
📝 crates/horizon-client/src/mobs/bee.rs (+2 -2)
📝 crates/horizon-client/src/mobs/goals.rs (+4 -4)
📝 crates/horizon-client/src/mobs/monster_brain.rs (+2 -2)
📝 crates/horizon-client/src/mobs/nav.rs (+28 -3)
📝 crates/horizon-client/src/mobs/piglin.rs (+7 -7)
📝 crates/horizon-client/src/mobs/raider.rs (+2 -2)
📝 crates/horizon-client/src/mobs/undead.rs (+2 -2)
📝 crates/horizon-client/src/mobs/villager_brain.rs (+2 -2)
📝 crates/horizon-client/src/mobs/warden_brain.rs (+2 -2)
📝 tools/test_mob_ai_parity.py (+4 -0)

📄 Description

🤖 Opened by Federico's AI agent (Claude), not by Federico himself.

Refs #3521.

Ticks the GroundPathNavigation.trimPath row of #3521 (checked: no open PR touches trimPath, avoidSun or RestrictSun, and #3521 has no comment about it).

What and why

RestrictSunGoal sets avoidSun on a skeleton's navigation by day. GroundPathNavigation.trimPath then cuts every path the mob starts, if the mob itself is out of the sky's sight, at its first node the sky sees. Horizon set the flag but never trimmed, so a skeleton chasing a player by day walked out into the sun.

Change

mobs/nav.rs: nav_move_to_path marks the stored path; the navigation's next tick (it has the world) runs trim_path: with avoid_sun on a ground or wall-climber navigation, if canSeeSky is false at the mob's (x, y + 0.5, z), the path keeps the nodes before the first node that canSeeSky.

Not in this PR

PathNavigation.trimPath's other part (a path node on a cauldron is lifted one block) is not ported.

Vanilla reference

GroundPathNavigation.trimPath, PathNavigation.moveTo(Path, double), Path.truncateNodes, Level.canSeeSky.

Testing

New mob_ai scenario skeleton_sun_path: a skeleton under a stone roof by day, the player in the open 12 blocks away. Before: diverges at tick 22 (vanilla path of 6 nodes, Horizon 13). After: 1/1, 121/121 mob-ticks. python3 tools/parity.py --fresh mob_ai: pass.

pr_ready --quick results follow in a comment; other parity harnesses are left to 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/3721 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/skeleton-path-stops-in-shade` --- ### 📝 Commits (10+) - [`5100563`](https://github.com/horizon-rust/horizon/commit/51005638e053af772e84032a2912bc3d4248040f) Skeletons: a path out of the shade stops at the first node the sky sees - [`183e772`](https://github.com/horizon-rust/horizon/commit/183e77272797e0585fb3207580d0c89ad3842c29) Merge remote-tracking branch 'origin/main' into upd-3721 - [`4ef3c1f`](https://github.com/horizon-rust/horizon/commit/4ef3c1f54a84568a03f0872da409bb93529802aa) Merge origin/main into fix/skeleton-path-stops-in-shade - [`8f7c959`](https://github.com/horizon-rust/horizon/commit/8f7c959679119e88cfee6de85e64d6f72dceb77b) Navigation: trimPath runs in moveTo, before the node count check - [`735cdab`](https://github.com/horizon-rust/horizon/commit/735cdab711bca9c76daf043f8cc85b1bc2c7251c) Merge origin/main into fix/skeleton-path-stops-in-shade - [`f1eedfc`](https://github.com/horizon-rust/horizon/commit/f1eedfcb40748cc7847bafe9c47813cf942bc8b9) Merge remote-tracking branch 'origin/main' into upd-3721 - [`9ee6b29`](https://github.com/horizon-rust/horizon/commit/9ee6b293d4d7c377628a9e788c5907452d4203aa) Merge remote-tracking branch 'origin/main' into upd-3721 - [`08e7c00`](https://github.com/horizon-rust/horizon/commit/08e7c00806fec64524508d49301c69732fed79a5) Merge remote-tracking branch 'origin/main' into upd-3721 - [`3bff52e`](https://github.com/horizon-rust/horizon/commit/3bff52e24252b12b30915093e452927c65891d67) Merge remote-tracking branch 'origin/main' into fix-3721 - [`fb83211`](https://github.com/horizon-rust/horizon/commit/fb8321177ba5570d3a33e850f04e5b3cf3ded467) Pass the world to nav_move_to_path in the callers main added ### 📊 Changes **11 files changed** (+57 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/animal_brain.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/bee.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/goals.rs` (+4 -4) 📝 `crates/horizon-client/src/mobs/monster_brain.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/nav.rs` (+28 -3) 📝 `crates/horizon-client/src/mobs/piglin.rs` (+7 -7) 📝 `crates/horizon-client/src/mobs/raider.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/undead.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/villager_brain.rs` (+2 -2) 📝 `crates/horizon-client/src/mobs/warden_brain.rs` (+2 -2) 📝 `tools/test_mob_ai_parity.py` (+4 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Refs #3521. Ticks the `GroundPathNavigation.trimPath` row of #3521 (checked: no open PR touches `trimPath`, `avoidSun` or `RestrictSun`, and #3521 has no comment about it). ## What and why `RestrictSunGoal` sets `avoidSun` on a skeleton's navigation by day. `GroundPathNavigation.trimPath` then cuts every path the mob starts, if the mob itself is out of the sky's sight, at its first node the sky sees. Horizon set the flag but never trimmed, so a skeleton chasing a player by day walked out into the sun. ## Change `mobs/nav.rs`: `nav_move_to_path` marks the stored path; the navigation's next tick (it has the world) runs `trim_path`: with `avoid_sun` on a ground or wall-climber navigation, if `canSeeSky` is false at the mob's `(x, y + 0.5, z)`, the path keeps the nodes before the first node that `canSeeSky`. ## Not in this PR `PathNavigation.trimPath`'s other part (a path node on a cauldron is lifted one block) is not ported. ## Vanilla reference `GroundPathNavigation.trimPath`, `PathNavigation.moveTo(Path, double)`, `Path.truncateNodes`, `Level.canSeeSky`. ## Testing New `mob_ai` scenario `skeleton_sun_path`: a skeleton under a stone roof by day, the player in the open 12 blocks away. Before: diverges at tick 22 (vanilla path of 6 nodes, Horizon 13). After: `1/1`, `121/121` mob-ticks. `python3 tools/parity.py --fresh mob_ai`: pass. `pr_ready --quick` results follow in a comment; other parity harnesses are left to 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:10:43 +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#5169
No description provided.