[PR #7284] [MERGED] Summoned spectral arrows, shulker bullets, spit and bottles fall #7461

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

📋 Pull Request Information

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

Base: main ← Head: fix/projectile-summon-gravity


📝 Commits (4)

  • 552cbc3 Summoned spectral arrows, shulker bullets, llama spit and experience bottles fall
  • 2aad087 Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity
  • 756e5cb Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity
  • bf3a0e4 Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity

📊 Changes

9 files changed (+240 additions, -21 deletions)

View changed files

📝 crates/horizon-client/src/arrows.rs (+3 -0)
📝 crates/horizon-client/src/entity_nbt.rs (+145 -6)
📝 crates/horizon-client/src/game/commands/data.rs (+2 -1)
📝 crates/horizon-client/src/game/creatures.rs (+12 -3)
📝 crates/horizon-client/src/game/debug_keys.rs (+1 -0)
📝 crates/horizon-client/src/game/deflect.rs (+1 -1)
📝 crates/horizon-client/src/game/persist.rs (+18 -2)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+1 -1)
📝 crates/horizon-client/src/projectiles.rs (+57 -7)

📄 Description

🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself.

What and why

A summoned spectral arrow, shulker bullet, llama spit or experience bottle never moved in Horizon: with Motion:[0.0d,0.0d,0.0d] and no NoGravity they stayed at y 110.0 for 20 ticks, where vanilla gives y 101.0465, y 101.6, and a spit and a bottle that land and are removed. With a nonzero Motion they did not move either. Cause: none of the four ids had a loader when /summon (or a chunk) builds an entity from NBT, so they fell through to the generic record that nothing ticks (game/persist.rs, the last match arms of the entity loader).

Changed, all in horizon-client:

  • game/persist.rs: spectral_arrow loads with arrow; llama_spit and shulker_bullet load as projectiles; experience_bottle loads with the thrown items (as ExperienceBottle).
  • entity_nbt.rs: spectral arrow defaults to the spectral arrow pickup item and is saved under its own id; new spit_or_bullet_from_nbt / spit_or_bullet_to_nbt; experience_bottle is a thrown item; spit and a target-less bullet are saved with the chunk, so @e and /data see them.
  • projectiles.rs: shulker bullet target is an Option; its tick uses getGravity (0.04, none under NoGravity) instead of a fixed 0.04; experience bottle is its own ProjectileKind::ExperienceBottle (own entity id, gravity 0.07, sprite), next to main's Potion(stack, lingering); a spectral arrow carries its own spectral flag on the arrow state; saved_with_chunk keeps main's exhaustive match, now saving LlamaSpit, ExperienceBottle and ShulkerBullet { target: None, .. } (a bullet with a target is not saved).

Not covered: a summoned minecraft:trident is created and ticked but @e and /data cannot find it (no Target variant for it, game/entity.rs, selector_target), so it cannot be compared through commands. Separate fix.

Fixes #7283

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • ShulkerBullet.tick: with no final target it calls applyGravity() and then moves; ShulkerBullet.getDefaultGravity is 0.04.
  • LlamaSpit.getDefaultGravity is 0.06; ThrownExperienceBottle.getDefaultGravity is 0.07; ThrowableProjectile.getDefaultGravity is 0.03; arrows are 0.05 (all read from the shipped 26.3 bytecode with tools/rea_vanilla.py).
  • Entity.applyGravity subtracts getGravity(), which is 0 under NoGravity.

Proof

Side-by-side scene projgrav (dedicated vanilla 26.3 server and Horizon fed the same console commands, all entities in force-loaded chunks, tolerance 1e-6). Seven kinds (arrow, spectral arrow, trident, shulker bullet, llama spit, experience bottle, splash potion) in three variants: plain with Motion 0, NoGravity:1b, and Motion:[0.2d,0.3d,0.1d]. Pos, Motion and NoGravity read at the start and after each of 20 single ticks: 1323 values.

values matching vanilla
origin/main 858 of 1323
this branch 1176 of 1323

The 147 values still different are all the trident (@e cannot select it, above). Every other kind, in all three variants and at every tick, matches vanilla, including y 101.0465 (spectral arrow) and y 101.6 (shulker bullet) after 20 ticks and the spit and bottle being gone.

Regression tests (horizon-client-lib), both fail with the fix reverted and pass with it:

  • summoned_projectiles_of_every_kind_load_and_honour_no_gravity (entity_nbt.rs): each kind loads from a summon compound, honours NoGravity, a spectral arrow and a bottle are saved under their own id.
  • a_shulker_bullet_without_a_target_falls_unless_no_gravity (projectiles.rs): y 101.6 after 20 ticks (with the fix reverted, NoGravity no longer holds it: left: 101.6, right: 110.0).

Harnesses

Run with DISPLAY=:0 HORIZON_E2E_HEADLESS=1, offscreen: python3 tools/parity.py arrow trident remote_fireball arrow_wind_charge pearl_wind_charge pearl_death: 6 passed, 0 failed. tools/pr_ready.py --quick after the last change: all checks pass (2133 tests, clippy, rustfmt, mod API) on the branch merged with main at 930931172; 297 parity harnesses are left to CI. After the merge the side-by-side was rerun: 1176 of 1323 again, only the trident differing, and the arrow and trident harnesses pass again.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 90d7eb163, 11 min 2 s)

Check Result
Scope ✅ 9 files, +240 −21
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (32 s)
rustfmt ✅ (8 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (1 min 42 s)
tests: horizon-client, horizon-client-lib ✅ 2143 passed (8 min 5 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (13 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 297 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute and 285 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/7284 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/projectile-summon-gravity` --- ### 📝 Commits (4) - [`552cbc3`](https://github.com/horizon-rust/horizon/commit/552cbc374911eb3bb9b70ae4d858ad7a8c579266) Summoned spectral arrows, shulker bullets, llama spit and experience bottles fall - [`2aad087`](https://github.com/horizon-rust/horizon/commit/2aad087ad342481dd2a44ce549d57282f7a45a0e) Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity - [`756e5cb`](https://github.com/horizon-rust/horizon/commit/756e5cba554b7fc79aee3f09cbd740487c9e7e8d) Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity - [`bf3a0e4`](https://github.com/horizon-rust/horizon/commit/bf3a0e467e3d4b6bc43c23583fd37aa5848f5a58) Merge remote-tracking branch 'origin/main' into fix/projectile-summon-gravity ### 📊 Changes **9 files changed** (+240 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/arrows.rs` (+3 -0) 📝 `crates/horizon-client/src/entity_nbt.rs` (+145 -6) 📝 `crates/horizon-client/src/game/commands/data.rs` (+2 -1) 📝 `crates/horizon-client/src/game/creatures.rs` (+12 -3) 📝 `crates/horizon-client/src/game/debug_keys.rs` (+1 -0) 📝 `crates/horizon-client/src/game/deflect.rs` (+1 -1) 📝 `crates/horizon-client/src/game/persist.rs` (+18 -2) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+1 -1) 📝 `crates/horizon-client/src/projectiles.rs` (+57 -7) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why A summoned spectral arrow, shulker bullet, llama spit or experience bottle never moved in Horizon: with `Motion:[0.0d,0.0d,0.0d]` and no `NoGravity` they stayed at y 110.0 for 20 ticks, where vanilla gives y 101.0465, y 101.6, and a spit and a bottle that land and are removed. With a nonzero `Motion` they did not move either. Cause: none of the four ids had a loader when `/summon` (or a chunk) builds an entity from NBT, so they fell through to the generic record that nothing ticks (`game/persist.rs`, the last match arms of the entity loader). Changed, all in `horizon-client`: - `game/persist.rs`: `spectral_arrow` loads with `arrow`; `llama_spit` and `shulker_bullet` load as projectiles; `experience_bottle` loads with the thrown items (as `ExperienceBottle`). - `entity_nbt.rs`: spectral arrow defaults to the spectral arrow pickup item and is saved under its own id; new `spit_or_bullet_from_nbt` / `spit_or_bullet_to_nbt`; `experience_bottle` is a thrown item; spit and a target-less bullet are saved with the chunk, so `@e` and `/data` see them. - `projectiles.rs`: shulker bullet `target` is an `Option`; its tick uses `getGravity` (0.04, none under `NoGravity`) instead of a fixed 0.04; experience bottle is its own `ProjectileKind::ExperienceBottle` (own entity id, gravity 0.07, sprite), next to main's `Potion(stack, lingering)`; a spectral arrow carries its own `spectral` flag on the arrow state; `saved_with_chunk` keeps main's exhaustive match, now saving `LlamaSpit`, `ExperienceBottle` and `ShulkerBullet { target: None, .. }` (a bullet with a target is not saved). Not covered: a summoned `minecraft:trident` is created and ticked but `@e` and `/data` cannot find it (no `Target` variant for it, `game/entity.rs`, `selector_target`), so it cannot be compared through commands. Separate fix. Fixes #7283 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `ShulkerBullet.tick`: with no final target it calls `applyGravity()` and then moves; `ShulkerBullet.getDefaultGravity` is 0.04. - `LlamaSpit.getDefaultGravity` is 0.06; `ThrownExperienceBottle.getDefaultGravity` is 0.07; `ThrowableProjectile.getDefaultGravity` is 0.03; arrows are 0.05 (all read from the shipped 26.3 bytecode with `tools/rea_vanilla.py`). - `Entity.applyGravity` subtracts `getGravity()`, which is 0 under `NoGravity`. ## Proof Side-by-side scene `projgrav` (dedicated vanilla 26.3 server and Horizon fed the same console commands, all entities in force-loaded chunks, tolerance 1e-6). Seven kinds (arrow, spectral arrow, trident, shulker bullet, llama spit, experience bottle, splash potion) in three variants: plain with `Motion` 0, `NoGravity:1b`, and `Motion:[0.2d,0.3d,0.1d]`. `Pos`, `Motion` and `NoGravity` read at the start and after each of 20 single ticks: 1323 values. | | values matching vanilla | |---|---| | origin/main | 858 of 1323 | | this branch | 1176 of 1323 | The 147 values still different are all the trident (`@e` cannot select it, above). Every other kind, in all three variants and at every tick, matches vanilla, including y 101.0465 (spectral arrow) and y 101.6 (shulker bullet) after 20 ticks and the spit and bottle being gone. Regression tests (`horizon-client-lib`), both fail with the fix reverted and pass with it: - `summoned_projectiles_of_every_kind_load_and_honour_no_gravity` (`entity_nbt.rs`): each kind loads from a summon compound, honours `NoGravity`, a spectral arrow and a bottle are saved under their own id. - `a_shulker_bullet_without_a_target_falls_unless_no_gravity` (`projectiles.rs`): y 101.6 after 20 ticks (with the fix reverted, `NoGravity` no longer holds it: `left: 101.6, right: 110.0`). ## Harnesses Run with `DISPLAY=:0 HORIZON_E2E_HEADLESS=1`, offscreen: `python3 tools/parity.py arrow trident remote_fireball arrow_wind_charge pearl_wind_charge pearl_death`: 6 passed, 0 failed. `tools/pr_ready.py --quick` after the last change: all checks pass (2133 tests, clippy, rustfmt, mod API) on the branch merged with main at 930931172; 297 parity harnesses are left to CI. After the merge the side-by-side was rerun: 1176 of 1323 again, only the trident differing, and the `arrow` and `trident` harnesses pass again. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 90d7eb163, 11 min 2 s) | Check | Result | | --- | --- | | Scope | ✅ 9 files, +240 −21 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (32 s) | | rustfmt | ✅ (8 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (1 min 42 s) | | tests: horizon-client, horizon-client-lib | ✅ 2143 passed (8 min 5 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (13 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 297 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, anvil_turtle_egg, armor_stand_frost, armor_stand_turtle_egg, arrow, arrow_wind_charge, attribute_health, attribute_map_queries, attribute and 285 more | | 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) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:39:49 +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#7461
No description provided.