[GH-ISSUE #6594] A saved fireball carries its Item, as vanilla's Fireball does #2148

Closed
opened 2026-11-02 15:52:30 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Akirabane on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6594

Originally assigned to: @Akirabane on GitHub.

🤖 Filed by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review.

A fireball saved by Horizon has no Item. Vanilla's Fireball (the parent of LargeFireball, minecraft:fireball, and SmallFireball, minecraft:small_fireball) always writes it, Items.FIRE_CHARGE by default, and reads it back (Fireball.addAdditionalSaveData / readAdditionalSaveData, read with javap on the 26.3 server jar; setItem refuses an empty stack and falls back to the default). In Horizon fireball_to_nbt / fireball_from_nbt (entity_nbt.rs) write the flight (acceleration_power, owner, flags, ExplosionPower) but not the item, so a /data get entity of a fireball or a chunk save shows none, and a /summon fireball ~ ~ ~ {Item:{id:"minecraft:diamond"}} loses its item on the first save.

No issue, pull request or branch for it that I could find on origin/main 50f98ecb3 (searched fireball, Item and fireball_to_nbt in open and closed pull requests and issues; #1605 was about projectiles never moving, since merged).

Plan

One small pull request, in entity_nbt.rs, as the thrown items already do (throwable_to_nbt: "the loaded item stays"):

  • fireball_to_nbt writes Item for LargeFireball and SmallFireball: the loaded item when there is one, else a fire charge, as vanilla does.
  • The loaded Item survives a load and a save (a round trip), and an empty or invalid one falls back to the fire charge, as setItem does.
  • Unit tests next to a_fireball_round_trips_its_flight.

Not in this slice: drawing a custom item in place of the fire charge (the renderer keeps the fire charge).

How it is checked

Unit tests as above, and in the game: /summon fireball with and without an Item, /data get entity on it, compared with what vanilla's rules above give. No bots and no benchmark.

I'm claiming it next, and will say here if the design needs to change.

Originally created by @Akirabane on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6594 Originally assigned to: @Akirabane on GitHub. > 🤖 Filed by both Akirabane's AI agent (Claude Code) and Akirabane himself, after his review. A fireball saved by Horizon has no `Item`. Vanilla's `Fireball` (the parent of `LargeFireball`, `minecraft:fireball`, and `SmallFireball`, `minecraft:small_fireball`) always writes it, `Items.FIRE_CHARGE` by default, and reads it back (`Fireball.addAdditionalSaveData` / `readAdditionalSaveData`, read with `javap` on the 26.3 server jar; `setItem` refuses an empty stack and falls back to the default). In Horizon `fireball_to_nbt` / `fireball_from_nbt` (`entity_nbt.rs`) write the flight (`acceleration_power`, owner, flags, `ExplosionPower`) but not the item, so a `/data get entity` of a fireball or a chunk save shows none, and a `/summon fireball ~ ~ ~ {Item:{id:"minecraft:diamond"}}` loses its item on the first save. No issue, pull request or branch for it that I could find on `origin/main` 50f98ecb3 (searched `fireball`, `Item` and `fireball_to_nbt` in open and closed pull requests and issues; #1605 was about projectiles never moving, since merged). ## Plan One small pull request, in `entity_nbt.rs`, as the thrown items already do (`throwable_to_nbt`: "the loaded item stays"): - `fireball_to_nbt` writes `Item` for `LargeFireball` and `SmallFireball`: the loaded item when there is one, else a fire charge, as vanilla does. - The loaded `Item` survives a load and a save (a round trip), and an empty or invalid one falls back to the fire charge, as `setItem` does. - Unit tests next to `a_fireball_round_trips_its_flight`. Not in this slice: drawing a custom item in place of the fire charge (the renderer keeps the fire charge). ## How it is checked Unit tests as above, and in the game: `/summon fireball` with and without an `Item`, `/data get entity` on it, compared with what vanilla's rules above give. No bots and no benchmark. I'm claiming it next, and will say here if the design needs to change.
Author
Owner

@Akirabane commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6565528994 --> @Akirabane commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
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#2148
No description provided.