[PR #2079] [MERGED] The ender dragon's hits and breath name it in the death message #3989

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

📋 Pull Request Information

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

Base: main ← Head: fix/enderman-death-message


📝 Commits (1)

  • 290e2e1 The ender dragon's hits and breath name it in the death message

📊 Changes

2 files changed (+22 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game/combat.rs (+8 -3)
📝 crates/horizon-client/src/game/dragon.rs (+14 -3)

📄 Description

Assisted by Claude Opus 5.5

What and why

Fixes #2062

The report's screenshot is in the End (end stone, an obsidian spike, the death screen's red tint), and its message is death.attack.indirectMagic, "%1$s was killed by %2$s using magic": the player died to the ender dragon's breath, not to an enderman. The dragon isn't drawn right now (#2014), so the endermen were the only mobs in sight.

The dragon's three ways of hurting the player (wing knockback, head and neck, breath clouds) call hurt_player_by without recording an attacker, and note_attacker couldn't name it anyway, since the dragon isn't one of self.mobs. The killing entry then has no attacker, combat_death_message_for passes only the victim to a two-argument template, and format_translation shows the malformed template verbatim. Every death to the dragon reads %1$s was killed by %2$s using magic or %1$s was slain by %2$s.

  • combat.rs: note_named_attacker, for an entity outside self.mobs; note_attacker goes through it.
  • dragon.rs: dragon_hurts_player records the dragon (its entity id, entity.minecraft.ender_dragon), then hurts the player; the three damage sites use it. Guests get it too, since as_fight_player runs with their combat tracker.

As in vanilla, the dragon also becomes the player's last attacker for 100 ticks (lastHurtByMob): a sitting tamed wolf near its owner stands up, and OwnerHurtByTargetGoal skips it because the mob world doesn't see the dragon.

The Discord thread was marked fixed after v0.2.68, but nothing between v0.2.67 and v0.2.68 touches combat.rs, dragon.rs, chat.rs or text.rs, and the dragon's damage on main still loses the name.

Vanilla reference

  • DamageSource.getLocalizedDeathMessage: with a causing entity, death.attack.<msgId> gets the victim and that entity's display name.
  • EnderDragon.hurt(List<Entity>) and EnderDragon.knockBack: damageSources().mobAttack(this).
  • AreaEffectCloud's tick → HealOrHarmMobEffect.applyInstantenousEffect(level, cloud, cloud.getOwner(), …) → damageSources().indirectMagic(cloud, owner); the dragon owns its breath (DragonSittingFlamingPhase) and its fireball's cloud (DragonFireball.onHit).

These weren't checked with tools/rea_vanilla.py (no game files on this machine), so they are worth a second look. No harness covers death message text, and none is added.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on Quantum, against upstream/main at 45bc45b39, 7 min 26 s)

Check Result
Scope ✅ 2 files, +22 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (41 s)
clippy ✅ (2 min 45 s)
tests: horizon-client ❌ failed (3 min 45 s)
doc tests ✅ 0 passed (12 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

The tests: horizon-client failure is this machine, not the change: with 16 GB of RAM, rustc aborted (0xc0000409) building the crate's test targets in parallel. Rerun with CARGO_BUILD_JOBS=2:

  • cargo test -p horizon-client --bin horizon-client (where game/ lives): 119 passed, 0 failed, the dragon tests among them.
  • cargo test -p horizon-client --lib: 1141 passed, 2 failed: crash::tests::stacks_start_at_the_panicking_frame and save::tests::session_lock_is_exclusive (os error 33, Windows' byte-range lock). Both are library code this change doesn't touch.

🔄 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/2079 **Author:** [@nirajkhetre](https://github.com/nirajkhetre) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/enderman-death-message` --- ### 📝 Commits (1) - [`290e2e1`](https://github.com/horizon-rust/horizon/commit/290e2e1ac7cb49bd9ec8a531ace9cbe1a165d092) The ender dragon's hits and breath name it in the death message ### 📊 Changes **2 files changed** (+22 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+8 -3) 📝 `crates/horizon-client/src/game/dragon.rs` (+14 -3) </details> ### 📄 Description > Assisted by Claude Opus 5.5 ## What and why Fixes #2062 The report's screenshot is in the End (end stone, an obsidian spike, the death screen's red tint), and its message is `death.attack.indirectMagic`, "%1$s was killed by %2$s using magic": the player died to the ender dragon's breath, not to an enderman. The dragon isn't drawn right now (#2014), so the endermen were the only mobs in sight. The dragon's three ways of hurting the player (wing knockback, head and neck, breath clouds) call `hurt_player_by` without recording an attacker, and `note_attacker` couldn't name it anyway, since the dragon isn't one of `self.mobs`. The killing entry then has no attacker, `combat_death_message_for` passes only the victim to a two-argument template, and `format_translation` shows the malformed template verbatim. Every death to the dragon reads `%1$s was killed by %2$s using magic` or `%1$s was slain by %2$s`. - `combat.rs`: `note_named_attacker`, for an entity outside `self.mobs`; `note_attacker` goes through it. - `dragon.rs`: `dragon_hurts_player` records the dragon (its entity id, `entity.minecraft.ender_dragon`), then hurts the player; the three damage sites use it. Guests get it too, since `as_fight_player` runs with their combat tracker. As in vanilla, the dragon also becomes the player's last attacker for 100 ticks (`lastHurtByMob`): a sitting tamed wolf near its owner stands up, and `OwnerHurtByTargetGoal` skips it because the mob world doesn't see the dragon. The Discord thread was marked fixed after v0.2.68, but nothing between v0.2.67 and v0.2.68 touches `combat.rs`, `dragon.rs`, `chat.rs` or `text.rs`, and the dragon's damage on main still loses the name. ## Vanilla reference - `DamageSource.getLocalizedDeathMessage`: with a causing entity, `death.attack.<msgId>` gets the victim and that entity's display name. - `EnderDragon.hurt(List<Entity>)` and `EnderDragon.knockBack`: `damageSources().mobAttack(this)`. - `AreaEffectCloud`'s tick → `HealOrHarmMobEffect.applyInstantenousEffect(level, cloud, cloud.getOwner(), …)` → `damageSources().indirectMagic(cloud, owner)`; the dragon owns its breath (`DragonSittingFlamingPhase`) and its fireball's cloud (`DragonFireball.onHit`). These weren't checked with `tools/rea_vanilla.py` (no game files on this machine), so they are worth a second look. No harness covers death message text, and none is added. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Quantum, against upstream/main at 45bc45b39, 7 min 26 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +22 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (41 s) | | clippy | ✅ (2 min 45 s) | | tests: horizon-client | ❌ failed (3 min 45 s) | | doc tests | ✅ 0 passed (12 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | The `tests: horizon-client` failure is this machine, not the change: with 16 GB of RAM, rustc aborted (0xc0000409) building the crate's test targets in parallel. Rerun with `CARGO_BUILD_JOBS=2`: - `cargo test -p horizon-client --bin horizon-client` (where `game/` lives): 119 passed, 0 failed, the dragon tests among them. - `cargo test -p horizon-client --lib`: 1141 passed, 2 failed: `crash::tests::stacks_start_at_the_panicking_frame` and `save::tests::session_lock_is_exclusive` (os error 33, Windows' byte-range lock). Both are library code this change doesn't touch. --- <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:49 +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#3989
No description provided.