[PR #1970] [MERGED] Mark a server's player dead while its arrival in a level is loading #3899

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

📋 Pull Request Information

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

Base: main ← Head: fix/1328-respawn-after-trip-death


📝 Commits (1)

  • d143666 Mark a server's player dead while its arrival in a level is loading

📊 Changes

1 file changed (+65 additions, -58 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_actions.rs (+65 -58)

📄 Description

Fixes #1328.

What and why

On the server thread, tick_guests skips a player who is on a trip into another level (its destination still
loading) before the part of the tick that marks a zero-health body dead. A death during the arrival (/kill,
damage) therefore only counted once the destination had loaded. The client already showed the death screen,
so a Respawn press in that window reached guest_respawn, which refuses a player not marked dead, and was
lost: the player stayed on the death screen until pressing Respawn a second time.

The death half of the guest tick (death message, loot, experience, PlayerCombatKill, the death animation) is
now its own guest_die, and it also runs for a player on a trip. The rest of the tick still leaves the
travelling body alone. No behaviour change for players who are not travelling.

Vanilla reference

LivingEntity.hurt → ServerPlayer.die happens at once, whatever is loaded. ServerGamePacketListenerImpl.handleClientCommand
(PERFORM_RESPAWN) → PlayerList.respawn for a dead player.

Rebased onto upstream/main after the death message moved to show_death_messages and the guest's own combat tracker: the move into guest_die was redone on that code unchanged; cargo check passes. The harness and in-game results below are from before that rebase.

Harnesses (the death path was moved, not changed):

  • python tools/test_hardcore_respawn_parity.py: hardcore respawn: 2 lines identical
  • python tools/test_cursor_death_parity.py: cursor death: 3 lines identical
  • python tools/test_server_dimension_players_parity.py: server dimension players: 40 lines identical

In game (release build, fresh survival world, driven with horizon-ctl):
/execute in minecraft:the_nether run tp @s 40000.5 100 40000.5, at once /kill @s, Respawn 1.3 s later.

  • Server thread, before the fix: still on the death screen in the Nether at health 0 15 s after the request.
  • Server thread, after the fix: back in the Overworld at the world spawn, health 20.
  • --in-frame: /kill after arriving, then Respawn: back in the Overworld, health 20 (this path does not use
    tick_guests).

Self-check

I did not paste a tools/pr_ready.py block: I work on Windows, where tools/parity.py cannot run (it needs
fcntl) and three horizon-client tests fail on upstream/main as well
(crash::tests::stacks_start_at_the_panicking_frame,
packs::cache::tests::directory_inputs_config_and_owned_output_recovery,
save::tests::session_lock_is_exclusive). cargo fmt --all -- --check passes; CI runs clippy and the
tests on Linux, and the harnesses above were run one by one (python tools/test_<name>_parity.py).


🔄 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/1970 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/25/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/1328-respawn-after-trip-death` --- ### 📝 Commits (1) - [`d143666`](https://github.com/horizon-rust/horizon/commit/d143666e46d910ea7bbad51fa6765f26500c9e07) Mark a server's player dead while its arrival in a level is loading ### 📊 Changes **1 file changed** (+65 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_actions.rs` (+65 -58) </details> ### 📄 Description Fixes #1328. ## What and why On the server thread, `tick_guests` skips a player who is on a trip into another level (its destination still loading) before the part of the tick that marks a zero-health body dead. A death during the arrival (`/kill`, damage) therefore only counted once the destination had loaded. The client already showed the death screen, so a Respawn press in that window reached `guest_respawn`, which refuses a player not marked dead, and was lost: the player stayed on the death screen until pressing Respawn a second time. The death half of the guest tick (death message, loot, experience, `PlayerCombatKill`, the death animation) is now its own `guest_die`, and it also runs for a player on a trip. The rest of the tick still leaves the travelling body alone. No behaviour change for players who are not travelling. ## Vanilla reference `LivingEntity.hurt` → `ServerPlayer.die` happens at once, whatever is loaded. `ServerGamePacketListenerImpl.handleClientCommand` (`PERFORM_RESPAWN`) → `PlayerList.respawn` for a dead player. Rebased onto upstream/main after the death message moved to `show_death_messages` and the guest's own combat tracker: the move into `guest_die` was redone on that code unchanged; `cargo check` passes. The harness and in-game results below are from before that rebase. Harnesses (the death path was moved, not changed): - `python tools/test_hardcore_respawn_parity.py`: `hardcore respawn: 2 lines identical` - `python tools/test_cursor_death_parity.py`: `cursor death: 3 lines identical` - `python tools/test_server_dimension_players_parity.py`: `server dimension players: 40 lines identical` In game (release build, fresh survival world, driven with horizon-ctl): `/execute in minecraft:the_nether run tp @s 40000.5 100 40000.5`, at once `/kill @s`, Respawn 1.3 s later. - Server thread, before the fix: still on the death screen in the Nether at health 0 15 s after the request. - Server thread, after the fix: back in the Overworld at the world spawn, health 20. - `--in-frame`: `/kill` after arriving, then Respawn: back in the Overworld, health 20 (this path does not use `tick_guests`). ## Self-check I did not paste a `tools/pr_ready.py` block: I work on Windows, where `tools/parity.py` cannot run (it needs `fcntl`) and three horizon-client tests fail on upstream/main as well (`crash::tests::stacks_start_at_the_panicking_frame`, `packs::cache::tests::directory_inputs_config_and_owned_output_recovery`, `save::tests::session_lock_is_exclusive`). `cargo fmt --all -- --check` passes; CI runs clippy and the tests on Linux, and the harnesses above were run one by one (`python tools/test_<name>_parity.py`). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:06 +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#3899
No description provided.