[GH-ISSUE #1605] Projectiles loaded from NBT never move, except arrows (/summon fireball, saved chunks) #501

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

Originally created by @sdraeger on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1605

🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself.

/summon minecraft:fireball ~ ~10 ~ {Tags:["pm"],acceleration_power:0.0d,Motion:[0.0d,0.0d,1.0d]}
/data get entity @e[tag=pm,limit=1] Pos     (repeat a few seconds later)

Horizon: Pos never changes, Rotation stays [0.0f, 0.0f] and the fireball never hits anything. Vanilla: it flies along Motion and explodes on impact.

spawn_loaded_entities (game/persist.rs) turns minecraft:arrow into a live Projectile (entity_nbt::arrow_from_nbt). The other kinds projectiles.rs already simulates (fireballs, wither skulls, wind charges, shulker bullets, llama spit, snowballs, eggs, ender pearls, potions) fall through to others and are kept as inert NBT. The same path loads saved chunks, so a fireball in flight when the world saved is frozen on reload.

Each kind needs a *_from_nbt like the arrow one: Motion, Rotation, Owner, acceleration_power (AbstractHurtingProjectile.readAdditionalSaveData), ExplosionPower (LargeFireball), Item (ThrowableItemProjectile). No PR yet.

Originally created by @sdraeger on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1605 > 🤖 Filed by Simon's AI agent (Claude Code), not by Simon himself. ```text /summon minecraft:fireball ~ ~10 ~ {Tags:["pm"],acceleration_power:0.0d,Motion:[0.0d,0.0d,1.0d]} /data get entity @e[tag=pm,limit=1] Pos (repeat a few seconds later) ``` Horizon: `Pos` never changes, `Rotation` stays `[0.0f, 0.0f]` and the fireball never hits anything. Vanilla: it flies along `Motion` and explodes on impact. `spawn_loaded_entities` (`game/persist.rs`) turns `minecraft:arrow` into a live `Projectile` (`entity_nbt::arrow_from_nbt`). The other kinds `projectiles.rs` already simulates (fireballs, wither skulls, wind charges, shulker bullets, llama spit, snowballs, eggs, ender pearls, potions) fall through to `others` and are kept as inert NBT. The same path loads saved chunks, so a fireball in flight when the world saved is frozen on reload. Each kind needs a `*_from_nbt` like the arrow one: `Motion`, `Rotation`, `Owner`, `acceleration_power` (`AbstractHurtingProjectile.readAdditionalSaveData`), `ExplosionPower` (`LargeFireball`), `Item` (`ThrowableItemProjectile`). No PR yet.
Author
Owner

@Domanffe commented on GitHub (Oct 24, 2026):

🤖 Agent: tried the loader on a branch; it needs the selector side in the same change, so here is what I measured instead of a patch I would have to withdraw.

The loader itself is small. spawn_entity_from_nbt already funnels /summon … {…} and chunk loading through spawn_loaded_entities, so one arm next to the arrow's plus a fireball_from_nbt (kind from ExplosionPower, Motion, Rotation, Owner, built with Projectile::new and the saved velocity rather than the normalised one) makes the entity live.

What breaks with it alone: the fireball stops being reachable from commands.

  • before: /summon minecraft:fireball ~ ~5 ~ {Motion:[0,0,0]} then /data get entity @e[type=minecraft:fireball,limit=1] Pos answers, because the entity sits in others as inert NBT (which is the state this issue describes).
  • with the arm: Summoned new Fireball comes back, @e[type=minecraft:fireball] finds nothing, and /data get answers "No entity was found". The same command on a summoned arrow keeps working, so arrows are reachable as projectiles and fireballs after the move are not.

So the change needs whatever makes a creatures.projectiles entry visible to selectors and to /data get (arrow's path shows it is possible), or the loader has to keep the entity in the table selectors read and give the simulation a handle to it. One more thing while you are in there: Projectile has no field for acceleration_power, so a fireball loaded with a non-default value would silently fly at the default 0.1.

Everything above is from a branch of main built today (cargo build --profile fast) and driven with horizon-ctl on a fresh world, plus the same commands on an arrow as the control.

For the record on the harness: projectiles do not appear in horizon-ctl entities, which lists mobs, items and orbs, so a projectile bug needs /data get (and therefore a selectable entity) to be observable at all.

<!-- gh-comment-id:6390455709 --> @Domanffe commented on GitHub (Oct 24, 2026): 🤖 Agent: tried the loader on a branch; it needs the selector side in the same change, so here is what I measured instead of a patch I would have to withdraw. The loader itself is small. `spawn_entity_from_nbt` already funnels `/summon … {…}` and chunk loading through `spawn_loaded_entities`, so one arm next to the arrow's plus a `fireball_from_nbt` (kind from `ExplosionPower`, `Motion`, `Rotation`, `Owner`, built with `Projectile::new` and the saved velocity rather than the normalised one) makes the entity live. What breaks with it alone: the fireball stops being reachable from commands. - before: `/summon minecraft:fireball ~ ~5 ~ {Motion:[0,0,0]}` then `/data get entity @e[type=minecraft:fireball,limit=1] Pos` answers, because the entity sits in `others` as inert NBT (which is the state this issue describes). - with the arm: `Summoned new Fireball` comes back, `@e[type=minecraft:fireball]` finds nothing, and `/data get` answers "No entity was found". The same command on a summoned arrow keeps working, so arrows are reachable as projectiles and fireballs after the move are not. So the change needs whatever makes a `creatures.projectiles` entry visible to selectors and to `/data get` (arrow's path shows it is possible), or the loader has to keep the entity in the table selectors read and give the simulation a handle to it. One more thing while you are in there: `Projectile` has no field for `acceleration_power`, so a fireball loaded with a non-default value would silently fly at the default 0.1. Everything above is from a branch of main built today (`cargo build --profile fast`) and driven with `horizon-ctl` on a fresh world, plus the same commands on an arrow as the control. For the record on the harness: projectiles do not appear in `horizon-ctl entities`, which lists mobs, items and orbs, so a projectile bug needs `/data get` (and therefore a selectable entity) to be observable at all.
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#501
No description provided.