[PR #3732] [MERGED] Wither skeleton: its piglin target goal comes first among the priority 3 goals #5179

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

📋 Pull Request Information

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

Base: main ← Head: fix/wither-skeleton-parity


📝 Commits (3)

  • 0c79bae Wither skeleton: its piglin target goal comes first among the priority 3 goals
  • f58660a Merge remote-tracking branch 'origin/main' into upd-3732
  • 6cd8cc4 Merge main into fix/wither-skeleton-parity (resolve tools/test_mob_ai_parity.py)

📊 Changes

2 files changed (+9 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/mobs/undead.rs (+8 -6)
📝 tools/test_mob_ai_parity.py (+1 -0)

📄 Description

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

Fixes #3754.

Found while testing #3729 (a wither skeleton scenario diverged at tick 2 whatever the world). Checked: no open PR touches the wither skeleton's goals.

What and why

WitherSkeleton.registerGoals adds NearestAttackableTargetGoal<AbstractPiglin> at priority 3 before super.registerGoals(), which adds the iron golem and turtle goals at priority 3. Goals of one priority run in insertion order, and each NearestAttackableTargetGoal.canUse draws a random interval, so the piglin goal draws first. Horizon registered it last: the draws came in another order and the mob's random stream (and with it every later goal) drifted from vanilla's at the second tick.

Change

mobs/undead.rs: the piglin goal is added before the others. tools/test_mob_ai_parity.py: wither_skeleton_player (a wither skeleton and a player 9 blocks away, 100 ticks).

Vanilla reference

WitherSkeleton.registerGoals, AbstractSkeleton.registerGoals, GoalSelector.tick.

Testing

Before: wither_skeleton_player diverges at tick 2 (vanilla draws 7 times, Horizon 6). After: 1/1, 101/101 mob-ticks. python3 tools/parity.py --fresh mob_ai: pass.

pr_ready --quick results follow in a comment.

🤖 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/3732 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/wither-skeleton-parity` --- ### 📝 Commits (3) - [`0c79bae`](https://github.com/horizon-rust/horizon/commit/0c79bae87d691de94164e6b14eccb6bf8e1b6052) Wither skeleton: its piglin target goal comes first among the priority 3 goals - [`f58660a`](https://github.com/horizon-rust/horizon/commit/f58660a875cee155d9b338dacafe83058590086e) Merge remote-tracking branch 'origin/main' into upd-3732 - [`6cd8cc4`](https://github.com/horizon-rust/horizon/commit/6cd8cc498719f544dbdab2cc51aa4e126a6511d2) Merge main into fix/wither-skeleton-parity (resolve tools/test_mob_ai_parity.py) ### 📊 Changes **2 files changed** (+9 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/undead.rs` (+8 -6) 📝 `tools/test_mob_ai_parity.py` (+1 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3754. Found while testing #3729 (a wither skeleton scenario diverged at tick 2 whatever the world). Checked: no open PR touches the wither skeleton's goals. ## What and why `WitherSkeleton.registerGoals` adds `NearestAttackableTargetGoal<AbstractPiglin>` at priority 3 **before** `super.registerGoals()`, which adds the iron golem and turtle goals at priority 3. Goals of one priority run in insertion order, and each `NearestAttackableTargetGoal.canUse` draws a random interval, so the piglin goal draws first. Horizon registered it last: the draws came in another order and the mob's random stream (and with it every later goal) drifted from vanilla's at the second tick. ## Change `mobs/undead.rs`: the piglin goal is added before the others. `tools/test_mob_ai_parity.py`: `wither_skeleton_player` (a wither skeleton and a player 9 blocks away, 100 ticks). ## Vanilla reference `WitherSkeleton.registerGoals`, `AbstractSkeleton.registerGoals`, `GoalSelector.tick`. ## Testing Before: `wither_skeleton_player` diverges at tick 2 (vanilla draws 7 times, Horizon 6). After: `1/1`, `101/101` mob-ticks. `python3 tools/parity.py --fresh mob_ai`: pass. `pr_ready --quick` results follow in a comment. 🤖 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:46 +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#5179
No description provided.