[PR #7390] [MERGED] Selectors and /data find thrown tridents, and NoGravity holds them #7570

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

📋 Pull Request Information

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

Base: main ← Head: fix/trident-selector


📝 Commits (5)

  • 4a326d8 Thrown tridents: reach them with @e, /kill and /data, and honour NoGravity
  • 9c4eaca Merge remote-tracking branch 'origin/main' into fix/trident-selector
  • 1756438 Regenerate the mod API output after the merge with main
  • 9f42824 Merge remote-tracking branch 'origin/main' into fix/trident-selector
  • 478ae85 Merge remote-tracking branch 'origin/main' into fix/trident-selector

📊 Changes

8 files changed (+74 additions, -9 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+13 -0)
📝 crates/horizon-client/src/game/commands.rs (+19 -0)
📝 crates/horizon-client/src/game/commands/data.rs (+7 -0)
📝 crates/horizon-client/src/game/entity.rs (+16 -2)
📝 crates/horizon-client/src/game/native_entities.rs (+1 -0)
📝 crates/horizon-client/src/game/persist.rs (+7 -5)
📝 crates/horizon-client/src/game/scoreboard.rs (+2 -0)
📝 crates/horizon-client/src/game/trident.rs (+9 -2)

📄 Description

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

What and why

Thrown tridents had no selector target, so @e, /kill, /data get, /tp and the other entity commands could not reach them. This adds a Target::Trident, keeps a trident's UUID and saved data by entity id (as for firework rockets) and makes NoGravity work on tridents: it is read from the NBT, kept, written back (only when set, as Entity.saveWithoutId does) and stops the 0.05 pull in both the local tick and the server-client flight.

/data merge onto a trident is not added (rockets don't have it either); /data get is.

Fixes #7389

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

ThrownTrident / AbstractArrow save data (inGround, life, shake, pickup, damage, item, DealtDamage, ...), Entity.isNoGravity and AbstractArrow.applyGravity, which skips gravity for a NoGravity entity. Selectors match every entity in the level.

Proof

Side-by-side projgrav scene (trident rows: summoned plain, with NoGravity:1b, and with Motion:[0.2,0.3,0.1], probed for 20 ticks, tolerance 1e-6):

trident values not matching vanilla
origin/main 147 (all "no entity")
with the selector target only 39 (NoGravity variant falls)
this change 0

Unit tests: a_thrown_trident_is_a_selector_target fails with the selector reverted (left: None, right: Some(Trident(9))) and passes with the change; rocket_and_trident_round_trip now covers NoGravity. The scene's rows for other projectile kinds still differ on origin/main; they are not part of this change.

Harnesses

Run locally (DISPLAY=:0 HORIZON_E2E_HEADLESS=1, own empty .local/parity-target): trident, arrow, server_entities all pass. tools/pr_ready.py --quick: rustfmt, clippy, 2132 tests and the Python tests pass; the 259 affected parity harnesses are left to CI (--quick).

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 953fbd73c, 9 min 49 s)

Check Result
Scope ✅ 8 files, +74 −9
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (30 s)
rustfmt ✅ (7 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 40 s)
tests: horizon-client, horizon-client-lib ✅ 2153 passed (7 min 7 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (14 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 259 affected, to run in CI (--quick): anvil_turtle_egg, armor_stand_turtle_egg, arrow, arrow_wind_charge, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer and 247 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/7390 **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/trident-selector` --- ### 📝 Commits (5) - [`4a326d8`](https://github.com/horizon-rust/horizon/commit/4a326d839b30f1c2439eacb4b4da0f5b4cd55c1e) Thrown tridents: reach them with @e, /kill and /data, and honour NoGravity - [`9c4eaca`](https://github.com/horizon-rust/horizon/commit/9c4eaca36e8158a392713c5a1d848932f004a927) Merge remote-tracking branch 'origin/main' into fix/trident-selector - [`1756438`](https://github.com/horizon-rust/horizon/commit/1756438f3b134c74215aaf905eda46f0c096dfa9) Regenerate the mod API output after the merge with main - [`9f42824`](https://github.com/horizon-rust/horizon/commit/9f4282439a316e53096e2f4a6a35cc3453382cbd) Merge remote-tracking branch 'origin/main' into fix/trident-selector - [`478ae85`](https://github.com/horizon-rust/horizon/commit/478ae85c20c84d68dcea715ff27abf2e0e51f8b5) Merge remote-tracking branch 'origin/main' into fix/trident-selector ### 📊 Changes **8 files changed** (+74 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+13 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+19 -0) 📝 `crates/horizon-client/src/game/commands/data.rs` (+7 -0) 📝 `crates/horizon-client/src/game/entity.rs` (+16 -2) 📝 `crates/horizon-client/src/game/native_entities.rs` (+1 -0) 📝 `crates/horizon-client/src/game/persist.rs` (+7 -5) 📝 `crates/horizon-client/src/game/scoreboard.rs` (+2 -0) 📝 `crates/horizon-client/src/game/trident.rs` (+9 -2) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why Thrown tridents had no selector target, so `@e`, `/kill`, `/data get`, `/tp` and the other entity commands could not reach them. This adds a `Target::Trident`, keeps a trident's UUID and saved data by entity id (as for firework rockets) and makes `NoGravity` work on tridents: it is read from the NBT, kept, written back (only when set, as `Entity.saveWithoutId` does) and stops the 0.05 pull in both the local tick and the server-client flight. `/data merge` onto a trident is not added (rockets don't have it either); `/data get` is. Fixes #7389 ## 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 `ThrownTrident` / `AbstractArrow` save data (`inGround`, `life`, `shake`, `pickup`, `damage`, `item`, `DealtDamage`, ...), `Entity.isNoGravity` and `AbstractArrow.applyGravity`, which skips gravity for a NoGravity entity. Selectors match every entity in the level. ## Proof Side-by-side `projgrav` scene (trident rows: summoned plain, with `NoGravity:1b`, and with `Motion:[0.2,0.3,0.1]`, probed for 20 ticks, tolerance 1e-6): | | trident values not matching vanilla | |---|---| | origin/main | 147 (all "no entity") | | with the selector target only | 39 (NoGravity variant falls) | | this change | 0 | Unit tests: `a_thrown_trident_is_a_selector_target` fails with the selector reverted (`left: None, right: Some(Trident(9))`) and passes with the change; `rocket_and_trident_round_trip` now covers `NoGravity`. The scene's rows for other projectile kinds still differ on origin/main; they are not part of this change. ## Harnesses Run locally (`DISPLAY=:0 HORIZON_E2E_HEADLESS=1`, own empty `.local/parity-target`): `trident`, `arrow`, `server_entities` all pass. `tools/pr_ready.py --quick`: rustfmt, clippy, 2132 tests and the Python tests pass; the 259 affected parity harnesses are left to CI (`--quick`). 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 953fbd73c, 9 min 49 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +74 −9 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (30 s) | | rustfmt | ✅ (7 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 40 s) | | tests: horizon-client, horizon-client-lib | ✅ 2153 passed (7 min 7 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (14 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 259 affected, to run in CI (--quick): anvil_turtle_egg, armor_stand_turtle_egg, arrow, arrow_wind_charge, auto_jump, block_entity_anim, block_entity_render, block_entity_tickers, block_particles, block_removal, block_tint, block_transformer and 247 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 07:20:00 +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#7570
No description provided.