[PR #1844] [MERGED] Let /ride mount and dismount mob riders #3809

Closed
opened 2026-11-03 04:12:27 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1844
Author: @kacpherek
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @ludovic111

Base: main ← Head: fix/1520-ride-mobs


📝 Commits (2)

  • f48cfb7 Let /ride mount and dismount mob riders
  • 8c54e18 /ride dismount: the boats' BOARDING_COOLDOWN, not a second 60

📊 Changes

4 files changed (+101 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/boat_passengers.rs (+1 -1)
📝 crates/horizon-client/src/game/commands/execute.rs (+1 -4)
📝 crates/horizon-client/src/game/commands/world_cmds.rs (+73 -15)
📝 tools/command_exec_corpus.py (+26 -0)

📄 Description

What and why

Fixes #1520.

/ride only handled the player as the rider. /ride <mob> mount <mob> always failed with "couldn't start riding", and /ride <mob> dismount said the mob was not riding anything, even for a passenger loaded from Passengers NBT that visibly moved with its vehicle.

/ride now finds a mob's vehicle the same way it finds the player's (ride_vehicle), so these work for mobs too:

  • "already riding", with the current vehicle's name;
  • the loop check, which follows the vehicle's own vehicles up the chain the way getSelfAndPassengers does;
  • mounting a mob on a mob, through the existing mount_mob (Entity.startRiding). The rider is placed on the vehicle by the next tick's position_riders, as in vanilla;
  • dismounting: the mob leaves its vehicle, gets the 60-tick boarding cooldown from Entity.removePassenger, and moves to where LivingEntity.dismountVehicle puts it. For a mob vehicle that is Entity.getDismountLocationForPassenger: the vehicle's x and z, at the top of its bounding box. For a boat it is the existing boat dismount spot;
  • execute on vehicle for a mob rider, which used the same lookup only for the player.

Not covered here: vehicles that override getDismountLocationForPassenger (horses, pigs, striders, camels and so on) still use the default spot for a mob rider, and a mob still can't be put into a boat or minecart with /ride.

Vanilla reference

  • RideCommand.mount and RideCommand.dismount (order of checks and messages).
  • Entity.startRiding(Entity, boolean, boolean), Entity.removeVehicle, Entity.removePassenger (boarding cooldown 60), LivingEntity.stopRiding, LivingEntity.dismountVehicle, Entity.getDismountLocationForPassenger.

Harness: I added a mob riding group to tools/command_exec_corpus.py (test_command_exec_parity.py). It covers not riding, riding a player, riding itself, mount, already riding, the loop, execute on vehicle, dismount and the position after it, and dismounting a passenger created with Passengers NBT. Before the fix 4 of its 12 commands matched vanilla; after it all 12 match. The whole harness passes: python3 tools/parity.py command_exec (1 passed). cargo check -p horizon-client and cargo fmt --check are clean.

Self-check

pr_ready (tools/pr_ready.py --quick on device-591, against origin/main at bd591f985, 4 min 12 s)

Check Result
Scope ✅ 3 files, +100 −19
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 267 passed (27 s)
rustfmt ✅ (7 s)
clippy ✅ (5 s)
tests: horizon-client ✅ 1236 passed (3 min 27 s)
doc tests ✅ 0 passed (2 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 319 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 307 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🔄 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/1844 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/25/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1520-ride-mobs` --- ### 📝 Commits (2) - [`f48cfb7`](https://github.com/horizon-rust/horizon/commit/f48cfb79661b9181ed62435e5009f1cd2bfc0543) Let /ride mount and dismount mob riders - [`8c54e18`](https://github.com/horizon-rust/horizon/commit/8c54e1858741b47dcca050cd5dc35b6d32f2d23c) /ride dismount: the boats' BOARDING_COOLDOWN, not a second 60 ### 📊 Changes **4 files changed** (+101 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/boat_passengers.rs` (+1 -1) 📝 `crates/horizon-client/src/game/commands/execute.rs` (+1 -4) 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+73 -15) 📝 `tools/command_exec_corpus.py` (+26 -0) </details> ### 📄 Description ## What and why Fixes #1520. `/ride` only handled the player as the rider. `/ride <mob> mount <mob>` always failed with "couldn't start riding", and `/ride <mob> dismount` said the mob was not riding anything, even for a passenger loaded from `Passengers` NBT that visibly moved with its vehicle. `/ride` now finds a mob's vehicle the same way it finds the player's (`ride_vehicle`), so these work for mobs too: - "already riding", with the current vehicle's name; - the loop check, which follows the vehicle's own vehicles up the chain the way `getSelfAndPassengers` does; - mounting a mob on a mob, through the existing `mount_mob` (`Entity.startRiding`). The rider is placed on the vehicle by the next tick's `position_riders`, as in vanilla; - dismounting: the mob leaves its vehicle, gets the 60-tick boarding cooldown from `Entity.removePassenger`, and moves to where `LivingEntity.dismountVehicle` puts it. For a mob vehicle that is `Entity.getDismountLocationForPassenger`: the vehicle's x and z, at the top of its bounding box. For a boat it is the existing boat dismount spot; - `execute on vehicle` for a mob rider, which used the same lookup only for the player. Not covered here: vehicles that override `getDismountLocationForPassenger` (horses, pigs, striders, camels and so on) still use the default spot for a mob rider, and a mob still can't be put into a boat or minecart with `/ride`. ## Vanilla reference - `RideCommand.mount` and `RideCommand.dismount` (order of checks and messages). - `Entity.startRiding(Entity, boolean, boolean)`, `Entity.removeVehicle`, `Entity.removePassenger` (boarding cooldown 60), `LivingEntity.stopRiding`, `LivingEntity.dismountVehicle`, `Entity.getDismountLocationForPassenger`. Harness: I added a `mob riding` group to `tools/command_exec_corpus.py` (`test_command_exec_parity.py`). It covers not riding, riding a player, riding itself, mount, already riding, the loop, `execute on vehicle`, dismount and the position after it, and dismounting a passenger created with `Passengers` NBT. Before the fix 4 of its 12 commands matched vanilla; after it all 12 match. The whole harness passes: `python3 tools/parity.py command_exec` (1 passed). `cargo check -p horizon-client` and `cargo fmt --check` are clean. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on device-591, against origin/main at bd591f985, 4 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +100 −19 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 267 passed (27 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (5 s) | | tests: horizon-client | ✅ 1236 passed (3 min 27 s) | | doc tests | ✅ 0 passed (2 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 319 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, bamboo, basic_feature and 307 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:12:27 +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#3809
No description provided.