[PR #3500] [MERGED] Firework rockets: explode on the entities they hit, credit their owner, and load from NBT #5028

Closed
opened 2026-11-03 05:09:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3500
Author: @spidercraft
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: fix/firework-gaps


📝 Commits (1)

  • 6c50b7d Firework rockets: explode on the entities they hit, credit their owner, and load from NBT

📊 Changes

6 files changed (+244 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+27 -0)
📝 crates/horizon-client/src/game/commands.rs (+4 -1)
📝 crates/horizon-client/src/game/crossbow.rs (+1 -1)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -1)
📝 crates/horizon-client/src/game/fireworks.rs (+206 -24)
📝 crates/horizon-client/src/game/persist.rs (+5 -0)

📄 Description

🤖 Opened by Claude Code.

Firework rockets were missing three things vanilla 26.3 does:

  • Entity hits. FireworkRocketEntity.tick checks its move for entities (ProjectileUtil.getHitResultOnMoveVector, boxes grown by computeMargin) and goes off on the first one it meets (onHitEntity → explode). Crossbow and dispenser rockets used to fly through mobs and players. A breeze turns a rocket back (ProjectileDeflection.REVERSE), and a rocket can't hit its owner until it has left them (Projectile.leftOwner), so elytra boosts are unchanged.
  • Owner credit. A rocket launched from a block, a glide or a crossbow is owned by the player (damageSources().fireworks(this, getOwner())), so a mob its blast kills counts as their kill: XP, player-only loot, stats. On a server the mobs it hurts answer to the guest who fired it (mob_players), as their arrows do. Dispenser rockets stay ownerless.
  • /summon and saved rockets. spawn_loaded_entities now loads minecraft:firework_rocket (Life, LifeTime, FireworksItem, ShotAtAngle, Owner, LeftOwner). Before, /summon firework_rocket made a placeholder entity that never flew or exploded. A bare summon has LifeTime 0 and explodes at once, as in vanilla. Rockets aren't written back on save, the same as primed TNT.

Checked in the game (headless, horizon-ctl), on both the server thread and --in-frame:

  • a crossbow rocket hits a chicken 7 blocks away within ~5 ticks and kills it, and the chicken drops XP;
  • a rocket launched off a block goes off on a chicken 4 blocks above it after ~12 ticks (its flight was ~40), and the chicken drops XP;
  • a summoned (ownerless) rocket kills a chicken in the same way, but no XP drops;
  • /summon firework_rocket {LifeTime:20,FireworksItem:…} flies and explodes;
  • an elytra boost still runs its full time (1.67 blocks/tick).

Not covered: the LAN-guest path wasn't run end to end (no vanilla data on this machine for lan_e2e), and neither were the parity harnesses (CI's parity job picks them). If another player's rocket kills you, the death message still doesn't name them.

pr_ready (tools/pr_ready.py --quick on SpiderPC, against origin/main at ac17fd2b0, 3 min 48 s)

Check Result
Scope ✅ 6 files, +244 −27
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 408 passed (24 s)
rustfmt ✅ (5 s)
clippy ✅ (1 min 21 s)
tests: horizon-client ✅ 1289 passed (1 min 32 s)
doc tests ✅ 0 passed (26 s)
content root tests ➖ content root untouched
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)

🤖 Generated with Claude Code


🔄 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/3500 **Author:** [@spidercraft](https://github.com/spidercraft) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/firework-gaps` --- ### 📝 Commits (1) - [`6c50b7d`](https://github.com/horizon-rust/horizon/commit/6c50b7d98001f2da822827f5e9882cdc86a99eca) Firework rockets: explode on the entities they hit, credit their owner, and load from NBT ### 📊 Changes **6 files changed** (+244 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+27 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+4 -1) 📝 `crates/horizon-client/src/game/crossbow.rs` (+1 -1) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -1) 📝 `crates/horizon-client/src/game/fireworks.rs` (+206 -24) 📝 `crates/horizon-client/src/game/persist.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by Claude Code. Firework rockets were missing three things vanilla 26.3 does: - **Entity hits.** `FireworkRocketEntity.tick` checks its move for entities (`ProjectileUtil.getHitResultOnMoveVector`, boxes grown by `computeMargin`) and goes off on the first one it meets (`onHitEntity` → `explode`). Crossbow and dispenser rockets used to fly through mobs and players. A breeze turns a rocket back (`ProjectileDeflection.REVERSE`), and a rocket can't hit its owner until it has left them (`Projectile.leftOwner`), so elytra boosts are unchanged. - **Owner credit.** A rocket launched from a block, a glide or a crossbow is owned by the player (`damageSources().fireworks(this, getOwner())`), so a mob its blast kills counts as their kill: XP, player-only loot, stats. On a server the mobs it hurts answer to the guest who fired it (`mob_players`), as their arrows do. Dispenser rockets stay ownerless. - **`/summon` and saved rockets.** `spawn_loaded_entities` now loads `minecraft:firework_rocket` (`Life`, `LifeTime`, `FireworksItem`, `ShotAtAngle`, `Owner`, `LeftOwner`). Before, `/summon firework_rocket` made a placeholder entity that never flew or exploded. A bare summon has `LifeTime` 0 and explodes at once, as in vanilla. Rockets aren't written back on save, the same as primed TNT. Checked in the game (headless, `horizon-ctl`), on both the server thread and `--in-frame`: - a crossbow rocket hits a chicken 7 blocks away within ~5 ticks and kills it, and the chicken drops XP; - a rocket launched off a block goes off on a chicken 4 blocks above it after ~12 ticks (its flight was ~40), and the chicken drops XP; - a summoned (ownerless) rocket kills a chicken in the same way, but no XP drops; - `/summon firework_rocket {LifeTime:20,FireworksItem:…}` flies and explodes; - an elytra boost still runs its full time (1.67 blocks/tick). Not covered: the LAN-guest path wasn't run end to end (no vanilla data on this machine for `lan_e2e`), and neither were the parity harnesses (CI's parity job picks them). If another player's rocket kills you, the death message still doesn't name them. **pr_ready** (`tools/pr_ready.py --quick` on SpiderPC, against origin/main at ac17fd2b0, 3 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +244 −27 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (24 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (1 min 21 s) | | tests: horizon-client | ✅ 1289 passed (1 min 32 s) | | doc tests | ✅ 0 passed (26 s) | | content root tests | ➖ content root untouched | | 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) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:42 +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#5028
No description provided.