[PR #7907] Arrows, tridents and snowballs strike boats and minecarts as in vanilla #7889

Open
opened 2026-11-03 07:26:12 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7907
Author: @HrafnaValkyrja
Created: 11/3/2026
Status: 🔄 Open

Base: main ← Head: fix/projectile-strikes-vehicles


📝 Commits (2)

  • 9bb1158 Arrows, tridents and snowballs strike boats and minecarts as vanilla's do
  • 31c4d89 Merge remote-tracking branch 'origin/main' into fix/projectile-vehicle-hits

📊 Changes

4 files changed (+195 additions, -16 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+68 -2)
📝 crates/horizon-client/src/game/native_projectiles.rs (+7 -2)
📝 crates/horizon-client/src/game/trident.rs (+58 -9)
📝 tools/lan_e2e.py (+62 -3)

📄 Description

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

What and why

Arrows, tridents and snowballs now strike boats and minecarts as vanilla's do. Before, boats were no target for any projectile and minecarts only for arrows, so a trident or a snowball flew through them and an arrow flew through a boat.

Three causes, all on the path from a projectile meeting a boat or minecart:

  • Vehicles were not targets. vehicle_targets (boats and minecarts) is added to the arrow targets (a trident entity is one of them), to the snowball's, to the mod-visible tick-through, and to the thrown trident's hit search. The hit then goes to hurt_boat / hurt_cart with the projectile's damage: an arrow's shot_damage, a trident's enchanted 8, a snowball's 0. A spent arrow or snowball is removed; the trident bounces. (game/creatures.rs, game/native_projectiles.rs, game/trident.rs)
  • The thrown trident's bounce was twice vanilla's, and it did not stop at the box. ThrownTrident.onHitEntity deflects with REVERSE, which already scales by -0.5, then by (0.02, 0.2, 0.02): the velocity becomes -0.01, -0.1, -0.01 of itself. Horizon used -0.02, -0.2, -0.02 and left the trident where its step began instead of where it met the box, which ProjectileUtil.computeMargin grows by (tickCount - 2) / 20 up to 0.3. This also showed against a pig. (game/trident.rs; the arrow-kind trident in arrows.rs already had the half.)
  • A trident's drag is the float 0.99F in vanilla; Horizon used the double 0.99, which put the second of two tridents 1.2e-6 off after 14 ticks. (game/trident.rs)

Not changed: the box margin of the other thrown projectiles (below); eggs, ender pearls, potions, fireballs and mod-registered thrown kinds still fly through boats and minecarts. Channeling's post-attack effect on a vehicle is not modelled.

Fixes #7900

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

VehicleEntity.hurtServer (flip hurtDir, hurtTime 10, markHurt, damage += amount * 10, destroyed when damage > 40 or a creative player hits), VehicleEntity.isPickable, AbstractArrow.onHitEntity (ceil(speed * baseDamage), hurtOrSimulate, discard), Snowball.onHitEntity (hurt(thrown, 0), 3 for a blaze), ThrownTrident.onHitEntity (8 through EnchantmentHelper.modifyDamage, deflect(REVERSE, ..., (0.02, 0.2, 0.02))), ProjectileUtil.getEntityHitResult and computeMargin.

Proof

Side-by-side scene against the real 26.3 server (dedicated servers, flat world, ticking chunks, tolerance 1e-6, vanilla run twice and its own noise ignored, 14 ticks): an arrow, a snowball and a trident flown into a boat and a minecart at speeds 0.5, 1.5 and 3.0, two hits of speed 1.5 in a row (damage accumulates to 60 and destroys), the tick-order flight (target moving -0.15 toward a speed-0.5 shot), and a trident into a pig. Pos and Motion of projectile and vehicle at ticks 1 to 14, and a count of the vehicle (gone or whole, which is what the damage field decides). Vanilla changed 49 of 91 probed values between ticks 1 and 14.

values matching vanilla
origin/main 1205 of 1670
this change 1654 of 1670

An arrow into a minecart already matched on main; every other arrow, snowball and trident row against a boat or minecart differed. The 16 values still different are one cell, a snowball shot at a boat or minecart moving toward it (shot 0.5, target -0.15, from tick 6): vanilla's snowball is spent, Horizon's flies on. Cause found, not fixed here: Horizon grows the box a thrown projectile meets by a fixed 0.3 (projectiles.rs), vanilla's margin is (tickCount - 2) / 20 up to 0.3. I tried the age margin: that cell matched, but pearl_wind_charge then failed (teleport y -56, vanilla -57; it passes with the fixed 0.3), so it is left for its own change. Vanilla keeps no Damage or HurtTime for a vehicle in its saved data, so the shake itself is not readable from a console; the damage is checked through what it decides (the vehicle destroyed at 60 and whole at 10 and 30) and the shake by the same hurt_boat / hurt_cart the player's attack and explosions use.

tools/lan_e2e.py --check projectile-vehicles (host with a console, an arrow of speed 3 and a trident into a boat and a minecart destroy it, a snowball is spent on it and leaves it whole, an arrow of 0.5 leaves a boat whole, and a thrown trident's Motion z after the hit is between -0.02 and 0): passes on this change; on origin/main it fails at the first case (arrow-3.0-oak_boat: the oak_boat stays).

Harnesses

DISPLAY=:0 HORIZON_E2E_HEADLESS=1, own empty .local/parity-target: tools/parity.py arrow arrow_wind_charge trident boat_authority boat_paddle_reset boat_submerged pearl_death pearl_wind_charge server_entities remote_fireworks: 10 passed, 0 failed in 4.8 min (arrow 57 s, arrow_wind_charge 155 s, trident 36 s, boat_authority 7 s, boat_paddle_reset 193 s, boat_submerged 287 s, pearl_death 183 s, pearl_wind_charge 154 s, server_entities 192 s, remote_fireworks 56 s). tools/pr_ready.py --quick: rustfmt, clippy, 711 tests in horizon-client and 614 Python tests pass; the other 210 affected parity harnesses are left to CI.

What wasn't compared

  • Eggs, pearls, potions, fireballs, wind charges and mod thrown kinds against vehicles; armor stands, item frames and paintings as targets.
  • A burning arrow's ignition of a boat, Channeling on a vehicle, TNT minecarts hit by a trident.
  • Join order: the snowball into a moving boat behaves the same in vanilla whichever of the two was summoned first; Horizon was run with the boat first only.
  • A player's own shots (no player in the scene), Loyalty and riptide.

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 31f83499b, 4 min 25 s)

Check Result
Scope ✅ 4 files, +195 −16
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (33 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 42 s)
tests: horizon-client ✅ 717 passed (1 min 40 s)
doc tests ✅ 0 passed (1 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 ➖ 257 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 245 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/7907 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/3/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/projectile-strikes-vehicles` --- ### 📝 Commits (2) - [`9bb1158`](https://github.com/horizon-rust/horizon/commit/9bb11589100b92d10fae1faca5ec5cee21b91dd9) Arrows, tridents and snowballs strike boats and minecarts as vanilla's do - [`31c4d89`](https://github.com/horizon-rust/horizon/commit/31c4d893f8a93ec315df78402409dfc33c394435) Merge remote-tracking branch 'origin/main' into fix/projectile-vehicle-hits ### 📊 Changes **4 files changed** (+195 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+68 -2) 📝 `crates/horizon-client/src/game/native_projectiles.rs` (+7 -2) 📝 `crates/horizon-client/src/game/trident.rs` (+58 -9) 📝 `tools/lan_e2e.py` (+62 -3) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why Arrows, tridents and snowballs now strike boats and minecarts as vanilla's do. Before, boats were no target for any projectile and minecarts only for arrows, so a trident or a snowball flew through them and an arrow flew through a boat. Three causes, all on the path from a projectile meeting a boat or minecart: - **Vehicles were not targets.** `vehicle_targets` (boats and minecarts) is added to the arrow targets (a trident entity is one of them), to the snowball's, to the mod-visible tick-through, and to the thrown trident's hit search. The hit then goes to `hurt_boat` / `hurt_cart` with the projectile's damage: an arrow's `shot_damage`, a trident's enchanted 8, a snowball's 0. A spent arrow or snowball is removed; the trident bounces. (`game/creatures.rs`, `game/native_projectiles.rs`, `game/trident.rs`) - **The thrown trident's bounce was twice vanilla's, and it did not stop at the box.** `ThrownTrident.onHitEntity` deflects with `REVERSE`, which already scales by -0.5, then by (0.02, 0.2, 0.02): the velocity becomes -0.01, -0.1, -0.01 of itself. Horizon used -0.02, -0.2, -0.02 and left the trident where its step began instead of where it met the box, which `ProjectileUtil.computeMargin` grows by `(tickCount - 2) / 20` up to 0.3. This also showed against a pig. (`game/trident.rs`; the arrow-kind trident in `arrows.rs` already had the half.) - **A trident's drag** is the float 0.99F in vanilla; Horizon used the double 0.99, which put the second of two tridents 1.2e-6 off after 14 ticks. (`game/trident.rs`) Not changed: the box margin of the other thrown projectiles (below); eggs, ender pearls, potions, fireballs and mod-registered thrown kinds still fly through boats and minecarts. Channeling's post-attack effect on a vehicle is not modelled. Fixes #7900 ## 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 `VehicleEntity.hurtServer` (flip `hurtDir`, `hurtTime` 10, `markHurt`, damage += amount * 10, destroyed when damage > 40 or a creative player hits), `VehicleEntity.isPickable`, `AbstractArrow.onHitEntity` (`ceil(speed * baseDamage)`, `hurtOrSimulate`, discard), `Snowball.onHitEntity` (`hurt(thrown, 0)`, 3 for a blaze), `ThrownTrident.onHitEntity` (8 through `EnchantmentHelper.modifyDamage`, `deflect(REVERSE, ..., (0.02, 0.2, 0.02))`), `ProjectileUtil.getEntityHitResult` and `computeMargin`. ## Proof Side-by-side scene against the real 26.3 server (dedicated servers, flat world, ticking chunks, tolerance 1e-6, vanilla run twice and its own noise ignored, 14 ticks): an arrow, a snowball and a trident flown into a boat and a minecart at speeds 0.5, 1.5 and 3.0, two hits of speed 1.5 in a row (damage accumulates to 60 and destroys), the tick-order flight (target moving -0.15 toward a speed-0.5 shot), and a trident into a pig. `Pos` and `Motion` of projectile and vehicle at ticks 1 to 14, and a count of the vehicle (gone or whole, which is what the damage field decides). Vanilla changed 49 of 91 probed values between ticks 1 and 14. | | values matching vanilla | |---|---| | origin/main | 1205 of 1670 | | this change | 1654 of 1670 | An arrow into a minecart already matched on main; every other arrow, snowball and trident row against a boat or minecart differed. The 16 values still different are one cell, a snowball shot at a boat or minecart moving toward it (shot 0.5, target -0.15, from tick 6): vanilla's snowball is spent, Horizon's flies on. Cause found, not fixed here: Horizon grows the box a thrown projectile meets by a fixed 0.3 (`projectiles.rs`), vanilla's margin is `(tickCount - 2) / 20` up to 0.3. I tried the age margin: that cell matched, but `pearl_wind_charge` then failed (teleport y -56, vanilla -57; it passes with the fixed 0.3), so it is left for its own change. Vanilla keeps no `Damage` or `HurtTime` for a vehicle in its saved data, so the shake itself is not readable from a console; the damage is checked through what it decides (the vehicle destroyed at 60 and whole at 10 and 30) and the shake by the same `hurt_boat` / `hurt_cart` the player's attack and explosions use. `tools/lan_e2e.py --check projectile-vehicles` (host with a console, an arrow of speed 3 and a trident into a boat and a minecart destroy it, a snowball is spent on it and leaves it whole, an arrow of 0.5 leaves a boat whole, and a thrown trident's Motion z after the hit is between -0.02 and 0): passes on this change; on origin/main it fails at the first case (`arrow-3.0-oak_boat: the oak_boat stays`). ## Harnesses `DISPLAY=:0 HORIZON_E2E_HEADLESS=1`, own empty `.local/parity-target`: `tools/parity.py arrow arrow_wind_charge trident boat_authority boat_paddle_reset boat_submerged pearl_death pearl_wind_charge server_entities remote_fireworks`: 10 passed, 0 failed in 4.8 min (arrow 57 s, arrow_wind_charge 155 s, trident 36 s, boat_authority 7 s, boat_paddle_reset 193 s, boat_submerged 287 s, pearl_death 183 s, pearl_wind_charge 154 s, server_entities 192 s, remote_fireworks 56 s). `tools/pr_ready.py --quick`: rustfmt, clippy, 711 tests in horizon-client and 614 Python tests pass; the other 210 affected parity harnesses are left to CI. ## What wasn't compared - Eggs, pearls, potions, fireballs, wind charges and mod thrown kinds against vehicles; armor stands, item frames and paintings as targets. - A burning arrow's ignition of a boat, Channeling on a vehicle, TNT minecarts hit by a trident. - Join order: the snowball into a moving boat behaves the same in vanilla whichever of the two was summoned first; Horizon was run with the boat first only. - A player's own shots (no player in the scene), Loyalty and riptide. 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 31f83499b, 4 min 25 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +195 −16 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (33 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 42 s) | | tests: horizon-client | ✅ 717 passed (1 min 40 s) | | doc tests | ✅ 0 passed (1 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 | ➖ 257 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 245 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>
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#7889
No description provided.