[GH-ISSUE #5526] lan_e2e boats and minecarts: ten punches two ticks apart don't break a vehicle #1715

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

Originally created by @navinor on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5526

🤖 Filed by navinor's AI agent (OpenCode, Claude Opus 5.5), not by navinor personally.

python3 tools/lan_e2e.py --check boats --check minecarts fails on main (6335ad584, Windows 11, fast build) at the last step of each check: "ten hits left the boat in place" and "ten hits left the minecart in place". Boarding, paddling and getting out pass.

Why

break_vehicle punches ten times, two ticks apart. Since bd09f8b03 the ten punches run in one horizon-ctl script, so they really are two ticks apart. Before that, each punch was its own horizon-ctl call, and the gaps between them were longer.

At two ticks apart, vanilla doesn't break the vehicle either:

  • Player.attack scales a hit by 0.2 + s² × 0.8, with s = getAttackStrengthScale(0.5) = (attackStrengthTicker + 0.5) / getCurrentItemAttackStrengthDelay(). A fist's delay is 20 / 4 = 5 ticks, so a punch 2 ticks after the last has s = 0.5 and does 0.4 damage.
  • VehicleEntity.hurtServer adds damage × 10 and destroys the vehicle once its damage passes 40; AbstractBoat.tick and AbstractMinecart.tick take 1 off every tick.
  • So the first punch adds 10, and each later one adds 4 and loses 2 to decay: 28 after ten punches, short of 40.

Horizon gets this right, so the test is what's wrong. A full-strength punch adds 10, so with the punches far enough apart to charge fully, the vehicle breaks on the 8th or 9th.

Fix

Space the punches a fist's full charge apart (with a tick to spare for when the server's tick lands) and give it enough of them, still in one script.

Originally created by @navinor on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5526 > 🤖 Filed by navinor's AI agent (OpenCode, Claude Opus 5.5), not by navinor personally. `python3 tools/lan_e2e.py --check boats --check minecarts` fails on main (`6335ad584`, Windows 11, fast build) at the last step of each check: "ten hits left the boat in place" and "ten hits left the minecart in place". Boarding, paddling and getting out pass. ## Why `break_vehicle` punches ten times, two ticks apart. Since bd09f8b03 the ten punches run in one `horizon-ctl` script, so they really are two ticks apart. Before that, each punch was its own `horizon-ctl` call, and the gaps between them were longer. At two ticks apart, vanilla doesn't break the vehicle either: - `Player.attack` scales a hit by `0.2 + s² × 0.8`, with `s = getAttackStrengthScale(0.5) = (attackStrengthTicker + 0.5) / getCurrentItemAttackStrengthDelay()`. A fist's delay is `20 / 4 = 5` ticks, so a punch 2 ticks after the last has `s = 0.5` and does 0.4 damage. - `VehicleEntity.hurtServer` adds `damage × 10` and destroys the vehicle once its damage passes 40; `AbstractBoat.tick` and `AbstractMinecart.tick` take 1 off every tick. - So the first punch adds 10, and each later one adds 4 and loses 2 to decay: 28 after ten punches, short of 40. Horizon gets this right, so the test is what's wrong. A full-strength punch adds 10, so with the punches far enough apart to charge fully, the vehicle breaks on the 8th or 9th. ## Fix Space the punches a fist's full charge apart (with a tick to spare for when the server's tick lands) and give it enough of them, still in one script.
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 31, 2026):

Claimed by Navinor on Discord (GitHub: navinor), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5526).

<!-- gh-comment-id:6549734777 --> @kira-horizon[bot] commented on GitHub (Oct 31, 2026): Claimed by `Navinor` on Discord (GitHub: `navinor`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #5526). <!-- kira:work -->
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#1715
No description provided.