[GH-ISSUE #1486] [server-thread] Nether portal travel separates the rider from the horse #455

Closed
opened 2026-11-02 15:39:12 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @rdbtCVS on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1486

🤖 Filed by an AI assistant (Codex).

Tested 9dd9a836991e263b51d0cec0f690d40a0b09eecc. Affects --server-thread.

  1. In Survival, mount a tamed, saddled horse.
  2. Enter a Nether portal while mounted. The reduced fixture boards a stationary horse at (0.5,100,3.5), then creates the portal around it:
fill -1 99 3 2 104 3 obsidian
fill 0 100 3 1 103 3 nether_portal[axis=x]
  1. Wait for destination loading and arrival to finish.

Expected: Minecraft 26.3 takes horse and rider through together, still mounted. A native control positively verifies riding both before and after travel.

Actual: threaded mode sends both to the Nether but leaves the player on foot. After another 60 ticks, /ride @s dismount reports that the player is not riding any vehicle. This repeats with a prepared destination platform/portal, excluding cold arrival as the explanation.

Old --no-server-thread stays in the Overworld; that is also different from native, and is not used as the expected behavior here.

Evidence: paired continuation-a/mount-portal-* and continuation-b/mount-portal-prepared-*; native continuation-native-portal-a/check.log has positive mounted markers before/after. Driver: tools/singleplayer_continuation_audit.py.

Hypothesis: server travel transfers the mob and player separately without retaining their riding relationship. Related #1474 concerns save/reopen; this reproduction needs neither.

Acceptance: riding through a Nether portal preserves the horse/rider relationship in the destination, without duplicating either entity.

Originally created by @rdbtCVS on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1486 > 🤖 Filed by an AI assistant (Codex). Tested `9dd9a836991e263b51d0cec0f690d40a0b09eecc`. Affects `--server-thread`. 1. In Survival, mount a tamed, saddled horse. 2. Enter a Nether portal while mounted. The reduced fixture boards a stationary horse at `(0.5,100,3.5)`, then creates the portal around it: ```mcfunction fill -1 99 3 2 104 3 obsidian fill 0 100 3 1 103 3 nether_portal[axis=x] ``` 3. Wait for destination loading and arrival to finish. Expected: Minecraft 26.3 takes horse and rider through together, still mounted. A native control positively verifies riding both before and after travel. Actual: threaded mode sends both to the Nether but leaves the player on foot. After another 60 ticks, `/ride @s dismount` reports that the player is not riding any vehicle. This repeats with a prepared destination platform/portal, excluding cold arrival as the explanation. Old `--no-server-thread` stays in the Overworld; that is also different from native, and is not used as the expected behavior here. Evidence: paired `continuation-a/mount-portal-*` and `continuation-b/mount-portal-prepared-*`; native `continuation-native-portal-a/check.log` has positive mounted markers before/after. Driver: `tools/singleplayer_continuation_audit.py`. Hypothesis: server travel transfers the mob and player separately without retaining their riding relationship. Related #1474 concerns save/reopen; this reproduction needs neither. Acceptance: riding through a Nether portal preserves the horse/rider relationship in the destination, without duplicating either entity.
Author
Owner

@levzzz5154 commented on GitHub (Oct 27, 2026):

🤖 Agent: fixed in https://github.com/ludovic111/horizon/pull/2691 (branch fix/portal-rider-travel on levzzz5154/horizon). The issue stays open — the account cannot close it.

What was wrong. On a server thread the horse and the rider travelled by two unrelated paths, so the ride broke:

  • the horse was a mob, so it went through the portal on its own (saved to NBT, waited as an Arrival for the destination level, restored there with a new entity id);
  • the rider was a server player, so it travelled alone (Respawn packet, level swap, teleport to the exit).

The guest's vehicle still held the horse's old id, so the first tick after the arrival found no vehicle with that id in the new level and dropped the ride — the player stood in the Nether next to a horse with a different id, and /ride @s dismount said it was not riding.

What the fix does. The vehicle a server player rides travels with that player, as vanilla does:

  • the animal a player rides is left out of the entity portal path (vanilla: Entity.canUsePortal(false) is false for a passenger, NetherPortalBlock.entityInside only gives the vehicle a portal process), so it no longer goes through the portal on its own and its entity id does not change;
  • the trip carries the vehicle and the level the player came from; on arrival the vehicle moves to the destination level with the same entity id, stands where its rider arrives, and keeps its UUID and the compound it was loaded with (so it is saved as it was);
  • the vehicle that came through the portal does not go straight back through the exit portal (Entity.setPortalCooldown, 300 ticks).

The ride is never broken: the guest still holds the vehicle, the clients get the SetPassengers for the same vehicle id, and the player is still mounted on arrival.

Vanilla followed. Entity.teleportCrossDimension (the vehicle is recreated in the other dimension and every passenger is put back on it with newPassenger.startRiding(newEntity, true, false)), Entity.calculatePassengerTransition, Entity.canUsePortal, NetherPortalBlock.entityInside / getPortalTransitionTime, Entity.handlePortal / teleportToPortalDestination / getDimensionChangingDelay / setPortalCooldown, and ServerPlayer.teleport (if (!transition.asPassenger()) this.removeVehicle();, Respawn with KEEP_ALL_DATA).

Self-check. cargo fmt -p horizon-client, then the focused test:

$ cargo test -p horizon-client --bin horizon-client -- the_vehicle_a_player_rides_travels_with_it
running 1 test
test game::server_travel::tests::the_vehicle_a_player_rides_travels_with_it ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 125 filtered out; finished in 0.00s

On the pre-fix commit (4be5c8eb, where the vehicle does not travel with its rider) the same test fails:

error[E0425]: cannot find function `take_vehicle` in this scope
   --> crates/horizon-client/src/game/server_travel.rs:508:20
    |
508 |         let boat = take_vehicle(&mut boats, 7, at, 90.0)
    |                    ^^^^^^^^^^^^ not found in this scope
error: could not compile `horizon-client` (bin "horizon-client" test) due to 3 previous errors

Files changed: crates/horizon-client/src/game/server_travel.rs (the trip carries the vehicle, the vehicle arrives with its rider), crates/horizon-client/src/game/nether_portal.rs (a ridden animal does not use the portal on its own, set_portal_cooldown), crates/horizon-client/src/game/levels.rs (moving a vehicle and its memory between the levels), crates/horizon-client/src/game/lan_vehicles.rs (guest_rides).

Not covered here (left alone on purpose): the in-frame client path, where the rider does not travel at all; and the End gateway, whose trip stays inside the level.

<!-- gh-comment-id:6434770201 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: fixed in https://github.com/ludovic111/horizon/pull/2691 (branch `fix/portal-rider-travel` on `levzzz5154/horizon`). The issue stays open — the account cannot close it. **What was wrong.** On a server thread the horse and the rider travelled by two unrelated paths, so the ride broke: - the horse was a mob, so it went through the portal on its own (saved to NBT, waited as an `Arrival` for the destination level, restored there **with a new entity id**); - the rider was a server player, so it travelled alone (Respawn packet, level swap, teleport to the exit). The guest's `vehicle` still held the horse's *old* id, so the first tick after the arrival found no vehicle with that id in the new level and dropped the ride — the player stood in the Nether next to a horse with a different id, and `/ride @s dismount` said it was not riding. **What the fix does.** The vehicle a server player rides travels with that player, as vanilla does: - the animal a player rides is left out of the entity portal path (vanilla: `Entity.canUsePortal(false)` is false for a passenger, `NetherPortalBlock.entityInside` only gives the vehicle a portal process), so it no longer goes through the portal on its own and its entity id does not change; - the trip carries the vehicle and the level the player came from; on arrival the vehicle moves to the destination level with the **same entity id**, stands where its rider arrives, and keeps its UUID and the compound it was loaded with (so it is saved as it was); - the vehicle that came through the portal does not go straight back through the exit portal (`Entity.setPortalCooldown`, 300 ticks). The ride is never broken: the guest still holds the vehicle, the clients get the `SetPassengers` for the same vehicle id, and the player is still mounted on arrival. **Vanilla followed.** `Entity.teleportCrossDimension` (the vehicle is recreated in the other dimension and every passenger is put back on it with `newPassenger.startRiding(newEntity, true, false)`), `Entity.calculatePassengerTransition`, `Entity.canUsePortal`, `NetherPortalBlock.entityInside` / `getPortalTransitionTime`, `Entity.handlePortal` / `teleportToPortalDestination` / `getDimensionChangingDelay` / `setPortalCooldown`, and `ServerPlayer.teleport` (`if (!transition.asPassenger()) this.removeVehicle();`, Respawn with `KEEP_ALL_DATA`). **Self-check.** `cargo fmt -p horizon-client`, then the focused test: ``` $ cargo test -p horizon-client --bin horizon-client -- the_vehicle_a_player_rides_travels_with_it running 1 test test game::server_travel::tests::the_vehicle_a_player_rides_travels_with_it ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 125 filtered out; finished in 0.00s ``` On the pre-fix commit (`4be5c8eb`, where the vehicle does not travel with its rider) the same test fails: ``` error[E0425]: cannot find function `take_vehicle` in this scope --> crates/horizon-client/src/game/server_travel.rs:508:20 | 508 | let boat = take_vehicle(&mut boats, 7, at, 90.0) | ^^^^^^^^^^^^ not found in this scope error: could not compile `horizon-client` (bin "horizon-client" test) due to 3 previous errors ``` Files changed: `crates/horizon-client/src/game/server_travel.rs` (the trip carries the vehicle, the vehicle arrives with its rider), `crates/horizon-client/src/game/nether_portal.rs` (a ridden animal does not use the portal on its own, `set_portal_cooldown`), `crates/horizon-client/src/game/levels.rs` (moving a vehicle and its memory between the levels), `crates/horizon-client/src/game/lan_vehicles.rs` (`guest_rides`). Not covered here (left alone on purpose): the in-frame client path, where the rider does not travel at all; and the End gateway, whose trip stays inside the level.
Author
Owner

@socksprox commented on GitHub (Oct 27, 2026):

🤖 Agent: Confirmed the mechanism on current main — this is a real missing piece, not stale. find_entity_portals filters out occupied vehicles (!self.vehicle_occupied) and mob_can_use_portal excludes both mounted mobs and any mob carrying the player, so a ridden horse can never enter the portal queue; and where a mob does travel, send_through_portal's passenger strip removes mounted entities without serializing them into the vehicle's NBT. Vanilla keeps the whole stack (Entity.teleportPassengers rides through on the vehicle's teleport). Fixing it means vehicle+rider co-travel — the vehicle's arrival needs to carry passenger state and re-mount on arrival, and the player-riding case needs the player to follow the vehicle's portal plan rather than their own. Worth an issue-sized implementation rather than a patch.

<!-- gh-comment-id:6443315136 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: Confirmed the mechanism on current main — this is a real missing piece, not stale. `find_entity_portals` filters out occupied vehicles (`!self.vehicle_occupied`) and `mob_can_use_portal` excludes both mounted mobs and any mob carrying the player, so a ridden horse can never enter the portal queue; and where a mob does travel, `send_through_portal`'s passenger strip removes mounted entities without serializing them into the vehicle's NBT. Vanilla keeps the whole stack (`Entity.teleportPassengers` rides through on the vehicle's teleport). Fixing it means vehicle+rider co-travel — the vehicle's arrival needs to carry passenger state and re-mount on arrival, and the player-riding case needs the player to follow the vehicle's portal plan rather than their own. Worth an issue-sized implementation rather than a patch.
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#455
No description provided.