[PR #3696] [MERGED] Chicken: PathType.WATER malus is 0, as in vanilla's constructor #5156

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

📋 Pull Request Information

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

Base: main ← Head: fix/chicken-water-malus


📝 Commits (3)

  • 398b1dd Chicken: water costs nothing to path through, as in vanilla's constructor
  • 01125c3 mob_ai: chicken and pig panic scenarios, one beside a pool
  • 49aa9dd Merge remote-tracking branch 'origin/main' into upd-3696

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/farm.rs (+2 -0)
📝 tools/test_mob_ai_parity.py (+7 -0)

📄 Description

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

Fixes #3695.

What and why

Vanilla's Chicken constructor calls setPathfindingMalus(PathType.WATER, 0.0F); Horizon left the default (8). Same gap as the fish in #3690. Water positions then fail GoalUtils.hasMalus in DefaultRandomPos, and paths through water cost more than in vanilla.

Change

  • mobs/farm.rs: set_malus(Water, 0.0) when a chicken is registered. No random draws involved.
  • tools/test_mob_ai_parity.py: chicken_panic_191, chicken_panic_192 (a hit chicken at the edge of a pool, with a player so the knockback matches), chicken_panic_dry and pig_panic_dry.

Vanilla reference

net.minecraft.world.entity.animal.chicken.Chicken.<init>.

Testing

  • Without the fix chicken_panic_192 diverges at tick 10: the chicken's path through the pool has 7 nodes in Horizon, 5 in vanilla. With it, 4/4 scenarios and 244/244 mob-ticks match.
  • python3 tools/parity.py --fresh mob_ai: pass (before adding the scenarios; the new ones pass as above).

pr_ready --quick: rustfmt ✅, clippy ✅ (-D warnings, all targets). 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/3696 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/chicken-water-malus` --- ### 📝 Commits (3) - [`398b1dd`](https://github.com/horizon-rust/horizon/commit/398b1dd2d815b9389edbbfbf689f4f9530cd6c2e) Chicken: water costs nothing to path through, as in vanilla's constructor - [`01125c3`](https://github.com/horizon-rust/horizon/commit/01125c302374c842d216d15cc3178b042b12d460) mob_ai: chicken and pig panic scenarios, one beside a pool - [`49aa9dd`](https://github.com/horizon-rust/horizon/commit/49aa9dd00bef412c072e18272d0de96472a1a3a4) Merge remote-tracking branch 'origin/main' into upd-3696 ### 📊 Changes **2 files changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/farm.rs` (+2 -0) 📝 `tools/test_mob_ai_parity.py` (+7 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3695. ## What and why Vanilla's `Chicken` constructor calls `setPathfindingMalus(PathType.WATER, 0.0F)`; Horizon left the default (8). Same gap as the fish in #3690. Water positions then fail `GoalUtils.hasMalus` in `DefaultRandomPos`, and paths through water cost more than in vanilla. ## Change - `mobs/farm.rs`: `set_malus(Water, 0.0)` when a chicken is registered. No random draws involved. - `tools/test_mob_ai_parity.py`: `chicken_panic_191`, `chicken_panic_192` (a hit chicken at the edge of a pool, with a player so the knockback matches), `chicken_panic_dry` and `pig_panic_dry`. ## Vanilla reference `net.minecraft.world.entity.animal.chicken.Chicken.<init>`. ## Testing - Without the fix `chicken_panic_192` diverges at tick 10: the chicken's path through the pool has 7 nodes in Horizon, 5 in vanilla. With it, `4/4` scenarios and `244/244` mob-ticks match. - `python3 tools/parity.py --fresh mob_ai`: pass (before adding the scenarios; the new ones pass as above). **pr_ready --quick**: rustfmt ✅, clippy ✅ (`-D warnings`, all targets). 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:38 +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#5156
No description provided.