[PR #2163] [MERGED] Mobs killed by a charged creeper drop their head #4063

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

📋 Pull Request Information

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

Base: main ← Head: fix/charged-creeper-heads


📝 Commits (1)

  • d057c89 Mobs killed by a charged creeper drop their head

📊 Changes

5 files changed (+53 additions, -15 deletions)

View changed files

📝 crates/horizon-client/src/game/combat.rs (+4 -0)
📝 crates/horizon-client/src/game/creatures.rs (+34 -14)
📝 crates/horizon-client/src/game/explosion.rs (+3 -1)
📝 crates/horizon-client/src/mobs.rs (+8 -0)
📝 crates/horizon-client/src/mobs/hostile.rs (+4 -0)

📄 Description

What and why

Mobs killed by a charged creeper dropped no head. A charged creeper's blast should make a zombie, skeleton, wither skeleton, creeper or piglin it kills drop its head (the charged_creeper loot table), once per creeper.

The drop code already existed (mobs::drops rolls charged_creeper/root when the damage source is a charged creeper) but nothing ever matched it:

  • Explosion damage to mobs had no attacker, so the loot context had no creeper in it.
  • The creeper is already gone from the mob list when its explosion is applied, and the victims are looted at the start of the next tick, so even with an attacker the game could not look the creeper up or see that it was charged.

The fix:

  • A creeper now sends MobEvent::ExplosionSource { mob, charged } right before its Explode. The game uses it as the explosion's source (instead of guessing the first mob within a block of the blast) and, for a charged creeper, remembers it until the mobs it killed have been looted.
  • Mobs hurt by the blast get that creeper as the damage's attacker (ServerExplosion's source entity).
  • The loot lookup falls back to the remembered creeper, and the first head dropped forgets it, so only one head drops per charged explosion.

Side effects, both as in vanilla: mobs hurt by a creeper now remember it as their attacker, and an enderman hurt by one no longer teleports as if the damage had no source.

Vanilla reference

  • Creeper.killedEntity (droppedSkulls, BuiltInLootTables.CHARGED_CREEPER), called from LivingEntity.die with the damage source's entity
  • data/minecraft/loot_table/charged_creeper/*.json
  • ServerExplosion.hurtEntities / Creeper.explodeCreeper: the exploding creeper is the damage source's entity

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/2163 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/charged-creeper-heads` --- ### 📝 Commits (1) - [`d057c89`](https://github.com/horizon-rust/horizon/commit/d057c891642f026589241fabcc82bb83a517be6d) Mobs killed by a charged creeper drop their head ### 📊 Changes **5 files changed** (+53 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/combat.rs` (+4 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+34 -14) 📝 `crates/horizon-client/src/game/explosion.rs` (+3 -1) 📝 `crates/horizon-client/src/mobs.rs` (+8 -0) 📝 `crates/horizon-client/src/mobs/hostile.rs` (+4 -0) </details> ### 📄 Description ## What and why Mobs killed by a charged creeper dropped no head. A charged creeper's blast should make a zombie, skeleton, wither skeleton, creeper or piglin it kills drop its head (the `charged_creeper` loot table), once per creeper. The drop code already existed (`mobs::drops` rolls `charged_creeper/root` when the damage source is a charged creeper) but nothing ever matched it: - Explosion damage to mobs had no attacker, so the loot context had no creeper in it. - The creeper is already gone from the mob list when its explosion is applied, and the victims are looted at the start of the next tick, so even with an attacker the game could not look the creeper up or see that it was charged. The fix: - A creeper now sends `MobEvent::ExplosionSource { mob, charged }` right before its `Explode`. The game uses it as the explosion's source (instead of guessing the first mob within a block of the blast) and, for a charged creeper, remembers it until the mobs it killed have been looted. - Mobs hurt by the blast get that creeper as the damage's attacker (`ServerExplosion`'s source entity). - The loot lookup falls back to the remembered creeper, and the first head dropped forgets it, so only one head drops per charged explosion. Side effects, both as in vanilla: mobs hurt by a creeper now remember it as their attacker, and an enderman hurt by one no longer teleports as if the damage had no source. ## Vanilla reference - `Creeper.killedEntity` (`droppedSkulls`, `BuiltInLootTables.CHARGED_CREEPER`), called from `LivingEntity.die` with the damage source's entity - `data/minecraft/loot_table/charged_creeper/*.json` - `ServerExplosion.hurtEntities` / `Creeper.explodeCreeper`: the exploding creeper is the damage source's entity ## 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:14:25 +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#4063
No description provided.