[PR #3729] [MERGED] Mobs: the path maluses vanilla's constructors set (fire, lava, powder snow, cocoa, trapdoors) #5175

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/3729
Author: @xFedeT
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: fix/constructor-path-maluses


📝 Commits (4)

  • 5071edb Mobs: the path maluses vanilla's constructors set (fire, lava, powder snow, cocoa, trapdoors)
  • b0c2f37 Merge remote-tracking branch 'origin/main' into upd-3729
  • 4e3a161 Merge main into fix/constructor-path-maluses (resolve tools/test_mob_ai_parity.py)
  • 0d9399e Merge main into fix/constructor-path-maluses (resolve tools/test_mob_ai_parity.py)

📊 Changes

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

View changed files

📝 crates/horizon-client/src/mobs/ai.rs (+84 -0)
📝 tools/test_mob_ai_parity.py (+3 -0)

📄 Description

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

Fixes #3753.

Same gap as the fish (#3690) and the chicken (#3696), for every other setPathfindingMalus call in vanilla's constructors (grep over the decompiled 26.3 sources; checked: no open PR touches them).

What and why

A mob's PathType maluses start from PathType's defaults and the constructors change them. Horizon only changed some (bee, sniffer, turtle, strider, warden, creaking, ...). Missing, so these mobs path through what vanilla's go around:

Vanilla class Maluses
Animal (36 species: farm animals, wolf, cat, fox, horses, hoglin, strider, ...) FIRE -1, FIRE_IN_NEIGHBOR 16
AbstractVillager (villager, wandering trader), AbstractPiglin (piglin, brute), CopperGolem the same
CopperGolem also DAMAGING_IN_NEIGHBOR 16
Fox DAMAGING_IN_NEIGHBOR 0, DAMAGING 0
Parrot FIRE_IN_NEIGHBOR -1, FIRE -1, COCOA -1
Frog WATER 4, TRAPDOOR -1
Goat, Wolf POWDER_SNOW -1, ON_TOP_OF_POWDER_SNOW -1
Blaze WATER -1, LAVA 8, FIRE_IN_NEIGHBOR 0, FIRE 0
ZombifiedPiglin, WitherSkeleton LAVA 8

Change

mobs/ai.rs: constructor_maluses, called first in register so a species' own register (bee, strider, sniffer, ...) still overrides it, as the constructors chain.

Vanilla reference

Animal.<init>, AbstractVillager.<init>, AbstractPiglin.<init>, CopperGolem.<init>, Fox.<init>, Parrot.<init>, Frog.<init>, Goat.<init>, Wolf.<init>, Blaze.<init>, ZombifiedPiglin.<init>, WitherSkeleton.<init>, PathType.

Testing

New mob_ai scenario pig_tempt_fire (a pig tempted by a player holding a carrot, a line of fire between them). Before: diverges at tick 4 (the path has 10 nodes in vanilla, 9 in Horizon). After: passes. python3 tools/parity.py --fresh mob_ai: pass.

Not covered by a scenario: lava for ZombifiedPiglin/WitherSkeleton and the other species; a wither skeleton scenario diverges at tick 2 for an unrelated reason (7 random draws in vanilla, 6 in Horizon), with or without lava.

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/3729 **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/constructor-path-maluses` --- ### 📝 Commits (4) - [`5071edb`](https://github.com/horizon-rust/horizon/commit/5071edb24806ab7de358ae81304749389e6995c4) Mobs: the path maluses vanilla's constructors set (fire, lava, powder snow, cocoa, trapdoors) - [`b0c2f37`](https://github.com/horizon-rust/horizon/commit/b0c2f375bb57dd931072ea86fa5a8aaf7a4e86d4) Merge remote-tracking branch 'origin/main' into upd-3729 - [`4e3a161`](https://github.com/horizon-rust/horizon/commit/4e3a161ac6a317c2e0e7839d79a4e2965049a9a5) Merge main into fix/constructor-path-maluses (resolve tools/test_mob_ai_parity.py) - [`0d9399e`](https://github.com/horizon-rust/horizon/commit/0d9399ead9dbc561d9d6982cd9c201315eebdbca) Merge main into fix/constructor-path-maluses (resolve tools/test_mob_ai_parity.py) ### 📊 Changes **2 files changed** (+87 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/ai.rs` (+84 -0) 📝 `tools/test_mob_ai_parity.py` (+3 -0) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3753. Same gap as the fish (#3690) and the chicken (#3696), for every other `setPathfindingMalus` call in vanilla's constructors (grep over the decompiled 26.3 sources; checked: no open PR touches them). ## What and why A mob's `PathType` maluses start from `PathType`'s defaults and the constructors change them. Horizon only changed some (bee, sniffer, turtle, strider, warden, creaking, ...). Missing, so these mobs path through what vanilla's go around: | Vanilla class | Maluses | |---|---| | `Animal` (36 species: farm animals, wolf, cat, fox, horses, hoglin, strider, ...) | `FIRE` -1, `FIRE_IN_NEIGHBOR` 16 | | `AbstractVillager` (villager, wandering trader), `AbstractPiglin` (piglin, brute), `CopperGolem` | the same | | `CopperGolem` | also `DAMAGING_IN_NEIGHBOR` 16 | | `Fox` | `DAMAGING_IN_NEIGHBOR` 0, `DAMAGING` 0 | | `Parrot` | `FIRE_IN_NEIGHBOR` -1, `FIRE` -1, `COCOA` -1 | | `Frog` | `WATER` 4, `TRAPDOOR` -1 | | `Goat`, `Wolf` | `POWDER_SNOW` -1, `ON_TOP_OF_POWDER_SNOW` -1 | | `Blaze` | `WATER` -1, `LAVA` 8, `FIRE_IN_NEIGHBOR` 0, `FIRE` 0 | | `ZombifiedPiglin`, `WitherSkeleton` | `LAVA` 8 | ## Change `mobs/ai.rs`: `constructor_maluses`, called first in `register` so a species' own `register` (bee, strider, sniffer, ...) still overrides it, as the constructors chain. ## Vanilla reference `Animal.<init>`, `AbstractVillager.<init>`, `AbstractPiglin.<init>`, `CopperGolem.<init>`, `Fox.<init>`, `Parrot.<init>`, `Frog.<init>`, `Goat.<init>`, `Wolf.<init>`, `Blaze.<init>`, `ZombifiedPiglin.<init>`, `WitherSkeleton.<init>`, `PathType`. ## Testing New `mob_ai` scenario `pig_tempt_fire` (a pig tempted by a player holding a carrot, a line of fire between them). Before: diverges at tick 4 (the path has 10 nodes in vanilla, 9 in Horizon). After: passes. `python3 tools/parity.py --fresh mob_ai`: pass. Not covered by a scenario: lava for `ZombifiedPiglin`/`WitherSkeleton` and the other species; a wither skeleton scenario diverges at tick 2 for an unrelated reason (7 random draws in vanilla, 6 in Horizon), with or without lava. `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: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#5175
No description provided.