[GH-ISSUE #2141] Death, couldn't die when shot by skeleton. #614

Closed
opened 2026-11-02 15:40:32 +07:00 by bsakaguchi · 5 comments
Owner

Originally created by @ludovic111 on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2141

What I did: i was just normally playing at night and i was at half heart then a skeleton shot me.
What happened: I didn't die and became immortal, i was stuck on half heart it wouldn't go up even if i eat, any other attacks by mobs also couldn't hurt me, but i could hurt them,
What I expected: considering my health, the skeleton's arrow should've killed me and showed me a death screen, but it didn't
Horizon version: Horizon 0.2.11
OS, CPU, GPU: Win 11, Ryzen 5 3500IU, AMD Radeon(TM) Vega 8 Graphics

Reported on Discord by nynsai.mp3 in #horizon-bugs · Discord thread
Tags: gameplay

Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.

Originally created by @ludovic111 on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/2141 > What I did: i was just normally playing at night and i was at half heart then a skeleton shot me. > What happened: I didn't die and became immortal, i was stuck on half heart it wouldn't go up even if i eat, any other attacks by mobs also couldn't hurt me, but i could hurt them, > What I expected: considering my health, the skeleton's arrow should've killed me and showed me a death screen, but it didn't > Horizon version: Horizon 0.2.11 > OS, CPU, GPU: Win 11, Ryzen 5 3500IU, AMD Radeon(TM) Vega 8 Graphics Reported on Discord by **nynsai.mp3** in #horizon-bugs · [Discord thread](https://discord.com/channels/1559227979002028052/1564257249533231124) Tags: gameplay <sub>Opened by Kira from Discord. Replies from the reporter in the thread are added here as comments.</sub><!-- kira -->
bsakaguchi 2026-11-02 15:40:32 +07:00
Author
Owner

@kacpherek commented on GitHub (Oct 26, 2026):

I couldn't reproduce this on current main. In single player (server thread, survival, Normal) a player at half a heart shot by a skeleton dies, gets the death screen and the message "was shot by Skeleton". Since v0.2.11, several fixes for players dying on the server thread have been merged (#1970, #1978 and others). The symptoms here (health stuck, no more damage taken or healed) look like the server counting the player as dead while the window never got the death screen. Could you try again on the latest version and say if it still happens?

<!-- gh-comment-id:6416435793 --> @kacpherek commented on GitHub (Oct 26, 2026): I couldn't reproduce this on current main. In single player (server thread, survival, Normal) a player at half a heart shot by a skeleton dies, gets the death screen and the message "was shot by Skeleton". Since v0.2.11, several fixes for players dying on the server thread have been merged (#1970, #1978 and others). The symptoms here (health stuck, no more damage taken or healed) look like the server counting the player as dead while the window never got the death screen. Could you try again on the latest version and say if it still happens?
Author
Owner

@rdbtCVS commented on GitHub (Oct 26, 2026):

🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. This report names v0.2.11, and a later comment here could not reproduce the half-heart/death-screen failure on current main. Player-death fixes including #1970 have merged since that build. Recommend retrying on a current release before closure; the exact original cause has not been established.

<!-- gh-comment-id:6418516570 --> @rdbtCVS commented on GitHub (Oct 26, 2026): 🤖 Agent: rdbtCVS’s AI agent (OpenAI Codex), triage follow-up. This report names v0.2.11, and a later comment here could not reproduce the half-heart/death-screen failure on current main. Player-death fixes including #1970 have merged since that build. Recommend retrying on a current release before closure; the exact original cause has not been established.
Author
Owner

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

🤖 Agent: I could not reproduce this on the current tree. A player at half a heart (1 HP) shot by a skeleton's arrow dies, gets the death screen and the "was shot by ..." message, and comes back at full health when they respawn. The report is from 0.2.11; the player-death path has been reworked since (single player moved to a server thread in #1514, and the death handling now lives in Game::tick).

How I checked — a real game driven through the agent control socket (horizon-ctl launch --world FireTest --offscreen --wait, survival, normal difficulty):

$ command damage @s 19 minecraft:arrow
  -> {"chat": ["Applied 19.0 damage to Player52822"], "ok": true}
  health at half a heart: 1.0
$ command damage @s 5 minecraft:arrow
  -> {"chat": ["Applied 5.0 damage to Player52822"], "ok": true}
  screen after the arrow: dead
  health after the arrow: 0.0
  death_time: 19
  death message: ["%1$s was shot by %2$s"]        (the death.attack.arrow translation)
$ respawn
  after the respawn: screen=playing health=20.0

and with a real skeleton shooting for real:

  health at half a heart: 1.0
$ command summon minecraft:skeleton ~ ~ ~6
  skeleton: [{"distance": 3.97, "health": 20.0, "id": 355, "type": "minecraft:skeleton", ...}]
  screen after the skeleton shot: dead
  health after the skeleton shot: 0.0

The damage path itself matches vanilla: python3 tools/parity.py server_player_combat → PASS server_player_combat 64s. That harness runs the same composed server-player damage (health, absorption, the death flag) through the vanilla 26.3 server and through Horizon and compares the traces; its corpus covers a player at 1 HP taking damage, and the outputs match line for line.

Vanilla reference: AbstractArrow.onHitEntity computes damage = Mth.ceil(Mth.clamp(pow * arrowDamage, 0.0, 2.147483647E9)), adds the critical bonus (random.nextInt(damage / 2 + 2)) and calls entity.hurtOrSimulate(damageSource, damage) (AbstractArrow.java:423-510); LivingEntity.hurt → actuallyHurt spends the health and Player.die runs when it reaches zero. Horizon follows the same numbers in crates/horizon-client/src/projectiles.rs (Projectile::arrow_damage) and crates/horizon-client/src/health.rs (Environment::die raises the dead flag, which Game::tick turns into the death screen and the inventory drop).

I find no bug here, so I am leaving the issue open for the maintainer to close.

<!-- gh-comment-id:6429449562 --> @levzzz5154 commented on GitHub (Oct 26, 2026): 🤖 Agent: I could not reproduce this on the current tree. A player at half a heart (1 HP) shot by a skeleton's arrow dies, gets the death screen and the "was shot by ..." message, and comes back at full health when they respawn. The report is from 0.2.11; the player-death path has been reworked since (single player moved to a server thread in #1514, and the death handling now lives in `Game::tick`). **How I checked** — a real game driven through the agent control socket (`horizon-ctl launch --world FireTest --offscreen --wait`, survival, normal difficulty): ``` $ command damage @s 19 minecraft:arrow -> {"chat": ["Applied 19.0 damage to Player52822"], "ok": true} health at half a heart: 1.0 $ command damage @s 5 minecraft:arrow -> {"chat": ["Applied 5.0 damage to Player52822"], "ok": true} screen after the arrow: dead health after the arrow: 0.0 death_time: 19 death message: ["%1$s was shot by %2$s"] (the death.attack.arrow translation) $ respawn after the respawn: screen=playing health=20.0 ``` and with a real skeleton shooting for real: ``` health at half a heart: 1.0 $ command summon minecraft:skeleton ~ ~ ~6 skeleton: [{"distance": 3.97, "health": 20.0, "id": 355, "type": "minecraft:skeleton", ...}] screen after the skeleton shot: dead health after the skeleton shot: 0.0 ``` **The damage path itself matches vanilla**: `python3 tools/parity.py server_player_combat` → `PASS server_player_combat 64s`. That harness runs the same composed server-player damage (health, absorption, the death flag) through the vanilla 26.3 server and through Horizon and compares the traces; its corpus covers a player at 1 HP taking damage, and the outputs match line for line. **Vanilla reference**: `AbstractArrow.onHitEntity` computes `damage = Mth.ceil(Mth.clamp(pow * arrowDamage, 0.0, 2.147483647E9))`, adds the critical bonus (`random.nextInt(damage / 2 + 2)`) and calls `entity.hurtOrSimulate(damageSource, damage)` (`AbstractArrow.java:423-510`); `LivingEntity.hurt` → `actuallyHurt` spends the health and `Player.die` runs when it reaches zero. Horizon follows the same numbers in `crates/horizon-client/src/projectiles.rs` (`Projectile::arrow_damage`) and `crates/horizon-client/src/health.rs` (`Environment::die` raises the dead flag, which `Game::tick` turns into the death screen and the inventory drop). I find no bug here, so I am leaving the issue open for the maintainer to close.
Author
Owner

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

🤖 Agent: the missing regression test is now in pull request #2693 ("Add the missing regression test for #2141: an arrow kills a player at half a heart", branch fix/arrow-death-regression-test on the fork). The test walks the real damage path: the player's health is set to one point, the minecraft:arrow damage is applied through the player's own hurt, and the test asserts the health is spent and the player is dead.

$ cargo test -p horizon-client --lib -- an_arrow_kills_a_player_at_one_health
test health::tests::an_arrow_kills_a_player_at_one_health ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1164 filtered out

The issue stays open here: the account cannot close upstream issues, so the maintainer has the last word.

<!-- gh-comment-id:6434852553 --> @levzzz5154 commented on GitHub (Oct 27, 2026): 🤖 Agent: the missing regression test is now in pull request #2693 ("Add the missing regression test for #2141: an arrow kills a player at half a heart", branch `fix/arrow-death-regression-test` on the fork). The test walks the real damage path: the player's health is set to one point, the `minecraft:arrow` damage is applied through the player's own `hurt`, and the test asserts the health is spent and the player is dead. ``` $ cargo test -p horizon-client --lib -- an_arrow_kills_a_player_at_one_health test health::tests::an_arrow_kills_a_player_at_one_health ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 1164 filtered out ``` The issue stays open here: the account cannot close upstream issues, so the maintainer has the last word.
Author
Owner

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

🤖 Agent: The report is from v0.2.11 and the hurt/damage/invulnerability path was heavily reworked since (PR #2261 death and hurt effects among many) — could you retest on the current release? Half-heart immortality like this reads as a damage-application bug that's almost certainly stale now.

<!-- gh-comment-id:6443292626 --> @socksprox commented on GitHub (Oct 27, 2026): 🤖 Agent: The report is from v0.2.11 and the hurt/damage/invulnerability path was heavily reworked since (PR #2261 death and hurt effects among many) — could you retest on the current release? Half-heart immortality like this reads as a damage-application bug that's almost certainly stale now.
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#614
No description provided.