[PR #2354] [MERGED] Credit the player who kills the ender dragon #4234

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

📋 Pull Request Information

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

Base: main ← Head: fix/dragon-kill-credit


📝 Commits (3)

  • a45c73b Credit the player who kills the ender dragon
  • 3fe301a Record the dragon's attacker before the crystal blast and only for applied damage
  • 380c405 Merge main into fix/dragon-kill-credit

📊 Changes

1 file changed (+87 additions, -4 deletions)

View changed files

📝 crates/horizon-client/src/game/dragon.rs (+87 -4)

📄 Description

What and why

Killing the ender dragon was never credited to the player. The "Free the End" advancement did not fire, and the ender_dragon killed statistic, the mob kill count and the kill score objectives stayed at zero. Only normal mobs were credited, and the dragon goes through its own death code.

The dragon now remembers the last player who hurt it (a melee hit, an arrow or other projectile, or breaking an end crystal next to it). When the killing blow lands, that player gets the kill: the killed statistic for minecraft:ender_dragon, mob_kills, the total kill scores, and the player_killed_entity trigger. This works the same for a guest on the server thread, who gets the credit on their own state. As in vanilla, a hit more than 100 ticks old is forgotten.

Vanilla reference

  • LivingEntity.die: getKillCredit() then awardKillScore, at the killing blow (not when the corpse is removed).
  • LivingEntity.hurtServer: a player's hit sets lastHurtByPlayer for 100 ticks.
  • ServerPlayer.awardKillScore: statistics, scores, PLAYER_KILLED_ENTITY trigger.
  • EnderDragon.handleKillingBlow, EnderDragon.hurt.

Self-check

cargo check -p horizon-client passes.


🔄 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/2354 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/dragon-kill-credit` --- ### 📝 Commits (3) - [`a45c73b`](https://github.com/horizon-rust/horizon/commit/a45c73bb36609301725aafb7fa66ae7a57387d3c) Credit the player who kills the ender dragon - [`3fe301a`](https://github.com/horizon-rust/horizon/commit/3fe301aaa1e610c095e26cb61882140b6419af89) Record the dragon's attacker before the crystal blast and only for applied damage - [`380c405`](https://github.com/horizon-rust/horizon/commit/380c40562dcbaf42c6482da03d8d0daf61c8e824) Merge main into fix/dragon-kill-credit ### 📊 Changes **1 file changed** (+87 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dragon.rs` (+87 -4) </details> ### 📄 Description ## What and why Killing the ender dragon was never credited to the player. The "Free the End" advancement did not fire, and the `ender_dragon` killed statistic, the mob kill count and the kill score objectives stayed at zero. Only normal mobs were credited, and the dragon goes through its own death code. The dragon now remembers the last player who hurt it (a melee hit, an arrow or other projectile, or breaking an end crystal next to it). When the killing blow lands, that player gets the kill: the `killed` statistic for `minecraft:ender_dragon`, `mob_kills`, the total kill scores, and the `player_killed_entity` trigger. This works the same for a guest on the server thread, who gets the credit on their own state. As in vanilla, a hit more than 100 ticks old is forgotten. ## Vanilla reference - `LivingEntity.die`: `getKillCredit()` then `awardKillScore`, at the killing blow (not when the corpse is removed). - `LivingEntity.hurtServer`: a player's hit sets `lastHurtByPlayer` for 100 ticks. - `ServerPlayer.awardKillScore`: statistics, scores, `PLAYER_KILLED_ENTITY` trigger. - `EnderDragon.handleKillingBlow`, `EnderDragon.hurt`. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:40 +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#4234
No description provided.