[GH-ISSUE #3695] Chicken: PathType.WATER malus should be 0, as in vanilla's constructor #1054

Closed
opened 2026-11-02 15:43:55 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @xFedeT on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3695

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

What: Horizon leaves a chicken's PathType.WATER malus at its default (8). Vanilla's Chicken constructor sets it to 0 (this.setPathfindingMalus(PathType.WATER, 0.0F)). With 8, GoalUtils.hasMalus rejects every water position in DefaultRandomPos (used by WaterAvoidingRandomStrollGoal when the chicken is in the water, and by other goals), and path costs through water differ, so a chicken's random draws and paths drift from vanilla's near water.

Found while: fixing the same gap for fish (#3631, PR #3690): WaterAnimal and AgeableWaterCreature set the same malus.

Where in Horizon: crates/horizon-client/src/mobs/farm.rs, the Species::Chicken arm of register.

Vanilla reference: net.minecraft.world.entity.animal.chicken.Chicken.<init>.

Side note: a mob_ai scenario with a hurt chicken beside a pool (panic goal) already diverges at the hurt tick (vanilla 11 random draws, Horizon 3), so the malus cannot be shown by a harness scenario until the chicken's PanicGoal position search matches vanilla. Not root-caused.

Originally created by @xFedeT on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3695 > 🤖 Filed by Federico's AI agent (Claude), not by Federico himself. **What:** Horizon leaves a chicken's `PathType.WATER` malus at its default (8). Vanilla's `Chicken` constructor sets it to 0 (`this.setPathfindingMalus(PathType.WATER, 0.0F)`). With 8, `GoalUtils.hasMalus` rejects every water position in `DefaultRandomPos` (used by `WaterAvoidingRandomStrollGoal` when the chicken is in the water, and by other goals), and path costs through water differ, so a chicken's random draws and paths drift from vanilla's near water. **Found while:** fixing the same gap for fish (#3631, PR #3690): `WaterAnimal` and `AgeableWaterCreature` set the same malus. **Where in Horizon:** `crates/horizon-client/src/mobs/farm.rs`, the `Species::Chicken` arm of `register`. **Vanilla reference:** `net.minecraft.world.entity.animal.chicken.Chicken.<init>`. **Side note:** a `mob_ai` scenario with a hurt chicken beside a pool (`panic` goal) already diverges at the hurt tick (vanilla 11 random draws, Horizon 3), so the malus cannot be shown by a harness scenario until the chicken's `PanicGoal` position search matches vanilla. Not root-caused.
Author
Owner

@xFedeT commented on GitHub (Oct 29, 2026):

🤖 Agent: correction to the side note above: the divergence at the hurt tick came from my scenario having no player (the oracle hurts with playerAttack, so the knockback direction depends on it). With a player the chicken's panic matches, and a chicken beside a pool shows the malus (PR #3696).

<!-- gh-comment-id:6497494836 --> @xFedeT commented on GitHub (Oct 29, 2026): 🤖 Agent: correction to the side note above: the divergence at the hurt tick came from my scenario having no `player` (the oracle hurts with `playerAttack`, so the knockback direction depends on it). With a player the chicken's panic matches, and a chicken beside a pool shows the malus (PR #3696).
Author
Owner

@xFedeT commented on GitHub (Oct 29, 2026):

🤖 Agent: PR #3696 is open with the fix and a mob_ai scenario that fails without it.

<!-- gh-comment-id:6499050484 --> @xFedeT commented on GitHub (Oct 29, 2026): 🤖 Agent: PR #3696 is open with the fix and a `mob_ai` scenario that fails without it.
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 29, 2026):

Claimed by FedeT_ on Discord (GitHub: xFedeT), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #3695).

<!-- gh-comment-id:6503884655 --> @kira-horizon[bot] commented on GitHub (Oct 29, 2026): Claimed by `FedeT_` on Discord (GitHub: `xFedeT`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #3695). <!-- kira:work -->
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#1054
No description provided.