[GH-ISSUE #6157] Arrow rotation animation is incorrect when fired upwards at low power #2000

Open
opened 2026-11-02 15:51:15 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @byMehd on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6157

When aiming straight up and firing an arrow with the lowest possible power, the arrow's rotation animation is incorrect in Horizon.

In vanilla Minecraft Java Edition, the arrow quickly turns around after being fired and then falls back down.

In Horizon, the arrow also turns around, but much later, making its rotation look noticeably different. It appears to fall while facing the wrong direction.

The arrow's power and trajectory are otherwise correct. This is purely a visual animation issue.

Please compare both animations side by side using the exact same aiming direction and bow charge, as the difference is clearly visible.

Originally created by @byMehd on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6157 When aiming straight up and firing an arrow with the lowest possible power, the arrow's rotation animation is incorrect in Horizon. In vanilla Minecraft Java Edition, the arrow quickly turns around after being fired and then falls back down. In Horizon, the arrow also turns around, but much later, making its rotation look noticeably different. It appears to fall while facing the wrong direction. The arrow's power and trajectory are otherwise correct. This is purely a visual animation issue. Please compare both animations side by side using the exact same aiming direction and bow charge, as the difference is clearly visible.
Author
Owner

@Akirabane commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6562537189 --> @Akirabane commented on GitHub (Nov 1, 2026): 🤖 Agent: /claim
Author
Owner

@Akirabane commented on GitHub (Nov 1, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6563256136 --> @Akirabane commented on GitHub (Nov 1, 2026): 🤖 Agent: /unclaim
Author
Owner

@kira-horizon[bot] commented on GitHub (Nov 1, 2026):

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

<!-- gh-comment-id:6565762345 --> @kira-horizon[bot] commented on GitHub (Nov 1, 2026): Claimed by `JustKrabby` on Discord (GitHub: `JustKarkat`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #6157). <!-- kira:work -->
Author
Owner

@JustKarkat commented on GitHub (Nov 1, 2026):

🤖 Agent: fixed on main by #6352 (244c866b5, merged 21:10 UTC) — but the current nightly predates it, so it cannot be retested yet.

What was wrong. The arrow's flight/turn was already correct: AbstractArrow.tick moves the aim 20% of the way to the flight direction each tick, and that matches vanilla to the bit. The draw was the problem. Vanilla updates Entity.yRotO/xRotO at the start of every tick (Entity.setOldPosAndRot) and ArrowRenderer draws Mth.lerp(partialTick, xRotO, yRot) / the same for the pitch, so a turning arrow is drawn between the two ticks it turned over. Horizon only kept a previous position: it drew the whole-tick rotation with an interpolated position, a tick ahead of where the arrow actually was — whole-tick steps of up to 36° while the arrow turns over at the apex.

The fix (crates/horizon-client/src/projectiles.rs, arrows.rs, remote_projectiles.rs, game/creatures.rs): Projectile::set_old_pos_and_rot now carries the rotation as well as the position on every tick (host arrows, remote/multiplayer arrows and shulker bullets), Projectile::shoot seeds the pair the way Projectile.shoot ends (yRotO = getYRot(); xRotO = getXRot()), and the arrow draw interpolates yaw and pitch. The same PR added the reported case — straight up at BowItem's lowest charge (0.1 power, 0.3 speed) — to tools/test_arrow_parity.py, whose corpus is compared bit-for-bit against real vanilla Arrow entities, plus a unit test (a_remote_arrow_keeps_the_rotation_the_last_tick_drew) that walks an arrow through its turn-over.

Which build to check. Nightly 2026-11-01 · c9d474d was published 19:09 UTC; #6352 merged at 21:10 UTC, so that build still has the old draw. Please give it another look on the next nightly and close if it turns over the way vanilla does.

<!-- gh-comment-id:6565813678 --> @JustKarkat commented on GitHub (Nov 1, 2026): 🤖 Agent: fixed on `main` by #6352 (`244c866b5`, merged 21:10 UTC) — but the current nightly predates it, so it cannot be retested yet. **What was wrong.** The arrow's flight/turn was already correct: `AbstractArrow.tick` moves the aim 20% of the way to the flight direction each tick, and that matches vanilla to the bit. The *draw* was the problem. Vanilla updates `Entity.yRotO`/`xRotO` at the start of every tick (`Entity.setOldPosAndRot`) and `ArrowRenderer` draws `Mth.lerp(partialTick, xRotO, yRot)` / the same for the pitch, so a turning arrow is drawn between the two ticks it turned over. Horizon only kept a previous *position*: it drew the whole-tick rotation with an interpolated position, a tick ahead of where the arrow actually was — whole-tick steps of up to 36° while the arrow turns over at the apex. **The fix** (`crates/horizon-client/src/projectiles.rs`, `arrows.rs`, `remote_projectiles.rs`, `game/creatures.rs`): `Projectile::set_old_pos_and_rot` now carries the rotation as well as the position on every tick (host arrows, remote/multiplayer arrows and shulker bullets), `Projectile::shoot` seeds the pair the way `Projectile.shoot` ends (`yRotO = getYRot(); xRotO = getXRot()`), and the arrow draw interpolates yaw and pitch. The same PR added the reported case — straight up at `BowItem`'s lowest charge (0.1 power, 0.3 speed) — to `tools/test_arrow_parity.py`, whose corpus is compared bit-for-bit against real vanilla `Arrow` entities, plus a unit test (`a_remote_arrow_keeps_the_rotation_the_last_tick_drew`) that walks an arrow through its turn-over. **Which build to check.** Nightly 2026-11-01 · `c9d474d` was published 19:09 UTC; #6352 merged at 21:10 UTC, so that build still has the old draw. Please give it another look on the next nightly and close if it turns over the way vanilla does.
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#2000
No description provided.