[GH-ISSUE #6365] Native mods: entity mount hook gaps (player id 0, boat and minecart pickup, cushion after a cancelled dismount) #2062

Closed
opened 2026-11-02 15:51:44 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @arismoko on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6365

Originally assigned to: @breachato on GitHub.

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

Three gaps in native_entity_mount (EntityMountEvent, #6281). They were found in the review of #6281, which merged at the reviewed head. All three are still on main at 648a748dc1.

1. A player's events can carry entity id 0.

  • Code: native_acting_entity (crates/horizon-client/src/game/native_mounts.rs:14-20) looks the acting guest up in lan_guest_entities(), which reads self.lan. While a guest's action runs, the hub is often taken out of self.lan, so the list is empty and the id is 0.
  • In game: on the server thread and on a dedicated server, every boat, minecart and horse interaction logged entity=0 kind=minecraft:player, though the player's id was 2. The same player's dismount from /ride … dismount or a teleport logged entity=2.
  • Effect: a mod can't tell which player is boarding.

2. A mob that a boat or minecart picks up doesn't fire the hook.

  • Code: boat pickup (crates/horizon-client/src/game/boat_passengers.rs:250) and minecart pickup (crates/horizon-client/src/game/minecarts.rs:1226) set the mob's mount directly, without asking the mods.
  • Vanilla 26.3: both go through Entity.startRiding.
  • In game: on a dedicated server a pig walked into a boat with no mount event. Its later /ride … dismount logged only the dismount.

3. A cancelled dismount is overwritten when the player sits on a cushion.

  • Code: after native_may_board, the cushion code calls self.stop_riding() and then sets self.riding = Some(id) unconditionally (crates/horizon-client/src/game/cushions.rs:344-345). If a mod cancelled the dismount from the old vehicle, the player is moved to the cushion anyway.
  • Vanilla: startRiding stops when stopRiding leaves the passenger seated.
  • This one was found by reading.

How to test: horizon-machine-sample is the recommended route, and the review used it. Log native_entity_mount and check:

  • the player id when boarding;
  • a pig pushed into a boat;
  • a cushion boarded while a mod cancels the dismount from a boat.
Originally created by @arismoko on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6365 Originally assigned to: @breachato on GitHub. > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. Three gaps in `native_entity_mount` (`EntityMountEvent`, #6281). They were found in [the review of #6281](https://github.com/horizon-rust/horizon/pull/6281#pullrequestreview-5729829527), which merged at the reviewed head. All three are still on main at `648a748dc1`. **1. A player's events can carry entity id 0.** - **Code:** `native_acting_entity` (`crates/horizon-client/src/game/native_mounts.rs:14-20`) looks the acting guest up in `lan_guest_entities()`, which reads `self.lan`. While a guest's action runs, the hub is often taken out of `self.lan`, so the list is empty and the id is 0. - **In game:** on the server thread and on a dedicated server, every boat, minecart and horse interaction logged `entity=0 kind=minecraft:player`, though the player's id was 2. The same player's dismount from `/ride … dismount` or a teleport logged `entity=2`. - **Effect:** a mod can't tell which player is boarding. **2. A mob that a boat or minecart picks up doesn't fire the hook.** - **Code:** boat pickup (`crates/horizon-client/src/game/boat_passengers.rs:250`) and minecart pickup (`crates/horizon-client/src/game/minecarts.rs:1226`) set the mob's `mount` directly, without asking the mods. - **Vanilla 26.3:** both go through `Entity.startRiding`. - **In game:** on a dedicated server a pig walked into a boat with no mount event. Its later `/ride … dismount` logged only the dismount. **3. A cancelled dismount is overwritten when the player sits on a cushion.** - **Code:** after `native_may_board`, the cushion code calls `self.stop_riding()` and then sets `self.riding = Some(id)` unconditionally (`crates/horizon-client/src/game/cushions.rs:344-345`). If a mod cancelled the dismount from the old vehicle, the player is moved to the cushion anyway. - **Vanilla:** `startRiding` stops when `stopRiding` leaves the passenger seated. - This one was found by reading. **How to test:** [horizon-machine-sample](https://github.com/arismoko/horizon-machine-sample) is the recommended route, and the review used it. Log `native_entity_mount` and check: - the player id when boarding; - a pig pushed into a boat; - a cushion boarded while a mod cancels the dismount from a boat.
Author
Owner

@breachato commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6563169907 --> @breachato commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
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#2062
No description provided.