[PR #7626] A mob riding a vehicle keeps its ground navigation #7726

Open
opened 2026-11-03 07:23:06 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7626
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/passenger-ground-navigation


📝 Commits (3)

  • 6cf5720 fix: a mob riding a vehicle keeps its ground navigation
  • b77cbcd test: a riding mob's ground navigation
  • 2d3dd5d port_map: GroundPathNavigation.canUpdatePath has its passenger arm

📊 Changes

2 files changed (+30 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/mobs/nav.rs (+29 -1)
📝 tools/port_map/game-010.tsv (+1 -1)

📄 Description

Vanilla

GroundPathNavigation.canUpdatePath() (javap -p -c -constants -cp ... net.minecraft.world.entity.ai.navigation.GroundPathNavigation):

 0: getfield      #23   // Field mob:Lnet/minecraft/world/entity/Mob;
 4: invokevirtual #27   // Mob.onGround:()Z
 7: ifne          30
10: getfield      #23
14: invokevirtual #33   // Mob.isInLiquid:()Z
17: ifne          30
20: getfield      #23
24: invokevirtual #36   // Mob.isPassenger:()Z
27: ifeq          34
30: iconst_1
34: iconst_0

Ground navigation (and wall climbing, which extends it) can make and follow a path when the mob is on the ground, in a liquid or riding a vehicle. PathNavigation.doTick only calls followThePath when it is true, recomputePath falls back to hasDelayedRecomputation when it is false, and PathNavigation.moveTo/createPath are how goals ask for a path at all.

Horizon

Mob::can_update_path had the ground/liquid pair and nothing for a passenger, and create_path_raw refuses to build a path at all when it is false. So a mob sitting on a vehicle - a piglin on a hoglin, a husk on a camel, a chicken jockey - could not path while riding: every move goal failed to get a path, and recompute_path only flagged a delayed recompute.

The arm is now || self.extra.mount.is_some(), which is isPassenger() for a mob.

Proven:

  • cargo test -p horizon-client-lib --lib mobs::nav: 4 passed; 0 failed.
  • With the new arm removed, a_mob_riding_a_vehicle_keeps_its_ground_navigation fails: panicked at ... nav.rs:797: riding a vehicle: isPassenger() - can_update_path() is false for the pig with extra.mount = Some(7), so no path can be made for it.
  • cargo clippy -q -p horizon-client-lib --lib is silent; rustfmt --edition 2024 --check on nav.rs is clean.

Not proven:

  • No in-game check with a real rider (a piglin on a hoglin, a husk on a camel): the unit test pins can_update_path only, not the goals that now get a path.
  • WallClimberNavigation inherits the ground rule in vanilla; the test covers the default ground navigation only.

🔄 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/7626 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/passenger-ground-navigation` --- ### 📝 Commits (3) - [`6cf5720`](https://github.com/horizon-rust/horizon/commit/6cf5720eefc1f08cbbb5dfce532c298b6a684e4c) fix: a mob riding a vehicle keeps its ground navigation - [`b77cbcd`](https://github.com/horizon-rust/horizon/commit/b77cbcd6bfd8bf6c26ed42d076374e3a8d1cb61d) test: a riding mob's ground navigation - [`2d3dd5d`](https://github.com/horizon-rust/horizon/commit/2d3dd5df59d50d1fa38bdb7a85f1a54429b6d821) port_map: GroundPathNavigation.canUpdatePath has its passenger arm ### 📊 Changes **2 files changed** (+30 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/mobs/nav.rs` (+29 -1) 📝 `tools/port_map/game-010.tsv` (+1 -1) </details> ### 📄 Description ### Vanilla `GroundPathNavigation.canUpdatePath()` (`javap -p -c -constants -cp ... net.minecraft.world.entity.ai.navigation.GroundPathNavigation`): ``` 0: getfield #23 // Field mob:Lnet/minecraft/world/entity/Mob; 4: invokevirtual #27 // Mob.onGround:()Z 7: ifne 30 10: getfield #23 14: invokevirtual #33 // Mob.isInLiquid:()Z 17: ifne 30 20: getfield #23 24: invokevirtual #36 // Mob.isPassenger:()Z 27: ifeq 34 30: iconst_1 34: iconst_0 ``` Ground navigation (and wall climbing, which extends it) can make and follow a path when the mob is on the ground, in a liquid **or riding a vehicle**. `PathNavigation.doTick` only calls `followThePath` when it is true, `recomputePath` falls back to `hasDelayedRecomputation` when it is false, and `PathNavigation.moveTo`/`createPath` are how goals ask for a path at all. ### Horizon `Mob::can_update_path` had the ground/liquid pair and nothing for a passenger, and `create_path_raw` refuses to build a path at all when it is false. So a mob sitting on a vehicle - a piglin on a hoglin, a husk on a camel, a chicken jockey - could not path while riding: every move goal failed to get a path, and `recompute_path` only flagged a delayed recompute. The arm is now `|| self.extra.mount.is_some()`, which is `isPassenger()` for a mob. **Proven:** - `cargo test -p horizon-client-lib --lib mobs::nav`: `4 passed; 0 failed`. - With the new arm removed, `a_mob_riding_a_vehicle_keeps_its_ground_navigation` fails: `panicked at ... nav.rs:797: riding a vehicle: isPassenger()` - `can_update_path()` is false for the pig with `extra.mount = Some(7)`, so no path can be made for it. - `cargo clippy -q -p horizon-client-lib --lib` is silent; `rustfmt --edition 2024 --check` on `nav.rs` is clean. **Not proven:** - No in-game check with a real rider (a piglin on a hoglin, a husk on a camel): the unit test pins `can_update_path` only, not the goals that now get a path. - `WallClimberNavigation` inherits the ground rule in vanilla; the test covers the default ground navigation only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7726
No description provided.