[PR #6780] [MERGED] TNT lit by a burning arrow credits the shooter, so a skeleton's kill drops a music disc #7090

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6780
Author: @DUzzL
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/6610-tnt-arrow-credit


📝 Commits (3)

📊 Changes

4 files changed (+51 additions, -12 deletions)

View changed files

📝 crates/horizon-client/examples/probe/arrow_probe.rs (+1 -1)
📝 crates/horizon-client/src/arrows.rs (+7 -1)
📝 crates/horizon-client/src/game/creatures.rs (+7 -2)
📝 crates/horizon-client/src/game/tnt.rs (+36 -8)

📄 Description

🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself.

Fixes #6610

What

TNT lit by a burning arrow now belongs to the arrow's owner. Before, the arrow primed the TNT with no owner, so the blast had no causing entity: a creeper it killed was not credited to the skeleton (no music disc), and a player's flaming arrow did not make the blast player_explosion either.

Why (vanilla)

  • TntBlock.onProjectileHit: owner = projectile.getOwner(), passed to prime(level, pos, owner instanceof LivingEntity ? owner : null, ...).
  • PrimedTnt.getOwner / Explosion.getIndirectSourceEntity: the blast's causing entity, so the damage source's attacker is that owner.
  • The creeper loot table's music-disc pool tests entity_properties on attacker being #minecraft:skeletons, which now holds.

Change

  • ArrowEvent::Block carries the arrow's owner; creatures.rs passes it to spawn_primed_tnt (it passed None).
  • tnt.rs: a mob owner is now resolved for the blast (tnt_blast_owner); it is null once the mob is gone, like getOwner.

Evidence

  • New unit test a_tnt_lit_by_a_skeletons_arrow_names_the_skeleton_as_its_cause (player, living mob, dead mob, no owner).
  • python tools/parity.py arrow: PASS (the Java oracle does not model the TNT owner, the existing spawn events are unchanged).
  • Not run in game: the credit chain was read from code (the loot-table side is already covered by test_entity_death_loot_parity.py).
  • Failures in pr_ready that are unrelated to this change and come from the Windows checkout (CRLF working tree): test_world_input_capture (capture.exe exit 101) and native_hooks::tests::native_breathing_stays_hookable / native_loot_kinds_stay_hookable (search the source for "\n}\n"). rustfmt failed on the first run (one import line), fixed in the second commit.

pr_ready (tools/pr_ready.py --base upstream/main, Windows, 217 min, run before the rustfmt fixup commit)

Check Result
Scope ✅ 4 files, +51 −11
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 596 run, errors=1 (test_world_input_capture, Windows only)
rustfmt ❌ one import line, fixed in 7abd58a8d
clippy ✅
tests: horizon-client ❌ 589 passed, 2 failed (native_hooks source scans, CRLF checkout)
doc tests ✅
Parity arrow ✅ PASS (run alone); the full 338-harness run did not report per-harness results

🔄 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/6780 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6610-tnt-arrow-credit` --- ### 📝 Commits (3) - [`b8c519c`](https://github.com/horizon-rust/horizon/commit/b8c519ce8fe84b91a01f1e58be6cbd5df4fb7053) TNT lit by a burning arrow belongs to the arrow's owner - [`7abd58a`](https://github.com/horizon-rust/horizon/commit/7abd58a8dd0811e7968b5432653b80c36b03d641) Format tnt.rs - [`bd366fa`](https://github.com/horizon-rust/horizon/commit/bd366fac94c44595f5b54d4796d6566f1d69ce0c) Merge main into #6780 ### 📊 Changes **4 files changed** (+51 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/arrow_probe.rs` (+1 -1) 📝 `crates/horizon-client/src/arrows.rs` (+7 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+7 -2) 📝 `crates/horizon-client/src/game/tnt.rs` (+36 -8) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent (Claude Code), not by DUzzL himself. Fixes #6610 ## What TNT lit by a burning arrow now belongs to the arrow's owner. Before, the arrow primed the TNT with no owner, so the blast had no causing entity: a creeper it killed was not credited to the skeleton (no music disc), and a player's flaming arrow did not make the blast `player_explosion` either. ## Why (vanilla) - `TntBlock.onProjectileHit`: `owner = projectile.getOwner()`, passed to `prime(level, pos, owner instanceof LivingEntity ? owner : null, ...)`. - `PrimedTnt.getOwner` / `Explosion.getIndirectSourceEntity`: the blast's causing entity, so the damage source's attacker is that owner. - The creeper loot table's music-disc pool tests `entity_properties` on `attacker` being `#minecraft:skeletons`, which now holds. ## Change - `ArrowEvent::Block` carries the arrow's owner; `creatures.rs` passes it to `spawn_primed_tnt` (it passed `None`). - `tnt.rs`: a mob owner is now resolved for the blast (`tnt_blast_owner`); it is null once the mob is gone, like `getOwner`. ## Evidence - New unit test `a_tnt_lit_by_a_skeletons_arrow_names_the_skeleton_as_its_cause` (player, living mob, dead mob, no owner). - `python tools/parity.py arrow`: PASS (the Java oracle does not model the TNT owner, the existing spawn events are unchanged). - Not run in game: the credit chain was read from code (the loot-table side is already covered by `test_entity_death_loot_parity.py`). - Failures in `pr_ready` that are unrelated to this change and come from the Windows checkout (CRLF working tree): `test_world_input_capture` (capture.exe exit 101) and `native_hooks::tests::native_breathing_stays_hookable` / `native_loot_kinds_stay_hookable` (search the source for `"\n}\n"`). rustfmt failed on the first run (one import line), fixed in the second commit. **pr_ready** (`tools/pr_ready.py --base upstream/main`, Windows, 217 min, run before the rustfmt fixup commit) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +51 −11 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 596 run, errors=1 (`test_world_input_capture`, Windows only) | | rustfmt | ❌ one import line, fixed in 7abd58a8d | | clippy | ✅ | | tests: horizon-client | ❌ 589 passed, 2 failed (`native_hooks` source scans, CRLF checkout) | | doc tests | ✅ | | Parity | `arrow` ✅ PASS (run alone); the full 338-harness run did not report per-harness results | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33:37 +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#7090
No description provided.