[PR #2086] [MERGED] Thrown projectiles: smooth flight on servers, eye shatter particles, potion arc #3994

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2086
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/thrown-eye-and-pearl


📝 Commits (1)

  • 6b60056 Thrown projectiles: fly on the client between server updates, eye shatter particles, potion motion order

📊 Changes

6 files changed (+209 additions, -61 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -0)
📝 crates/horizon-client/src/game/creatures.rs (+3 -3)
📝 crates/horizon-client/src/game/end.rs (+56 -4)
📝 crates/horizon-client/src/game/potions.rs (+71 -20)
📝 crates/horizon-client/src/game/remote.rs (+21 -7)
📝 crates/horizon-client/src/game/remote_projectiles.rs (+55 -27)

📄 Description

What and why

Three things players see when they throw things.

Projectiles stutter on a server. Arrows, snowballs, eggs, ender pearls, splash potions and eyes of ender only eased towards the position the server tracks. The server sends that every 10 ticks for thrown items and every 20 for arrows, so on a server (and in a LAN world) they moved in jerks and cut corners on their arc, which made pearls look like they fly too low.

In vanilla these entities keep Entity's no-op interpolation handler: a move packet puts them at the server's position at once, and their own client tick flies them on with gravity and drag until the next update. Now Horizon does the same:

  • arrows: water drag before the move, air drag (0.99) and gravity (0.05) after it, and a block they reach holds them;
  • snowballs, eggs, pearls, wind charges, fireballs and the rest: the same Projectile::tick the local game uses, with no targets (only the server decides hits);
  • potions: gravity, drag, move, stop at a block;
  • eyes of ender: move by their last known motion; motion packets now reach potions and eyes too.

The ghast fireball already worked this way; this covers the rest.

Fixes #1826 (an arrow stays where it was shot until it lands) and #1762 (eggs, pearls and wind charges hang in the air for a moment after the throw): both are this interpolation towards sparse updates.

A shattered eye of ender had no effect. The eye that breaks (1 in 5) now sends level event 2003, which draws its item crumbs and the two rings of portal particles.

Potions took a slightly wrong arc. Thrown potions moved first and applied gravity and drag after. ThrowableProjectile.tick applies gravity, then drag (0.8 in water), then moves.

Vanilla reference

  • Entity.moveOrInterpolateTo with InterpolationHandler.NO_OP (only living entities, boats, minecarts, displays, orbs, fishing hooks and shulkers override createInterpolationHandler)
  • AbstractArrow.tick, ThrowableProjectile.tick, EyeOfEnder.tick
  • LevelEventHandler case 2003

Self-check

cargo check -p horizon-client passes.


🔄 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/2086 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/thrown-eye-and-pearl` --- ### 📝 Commits (1) - [`6b60056`](https://github.com/horizon-rust/horizon/commit/6b6005663791e575e5d0776ef49a54f65b34fac1) Thrown projectiles: fly on the client between server updates, eye shatter particles, potion motion order ### 📊 Changes **6 files changed** (+209 additions, -61 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -3) 📝 `crates/horizon-client/src/game/end.rs` (+56 -4) 📝 `crates/horizon-client/src/game/potions.rs` (+71 -20) 📝 `crates/horizon-client/src/game/remote.rs` (+21 -7) 📝 `crates/horizon-client/src/game/remote_projectiles.rs` (+55 -27) </details> ### 📄 Description ## What and why Three things players see when they throw things. **Projectiles stutter on a server.** Arrows, snowballs, eggs, ender pearls, splash potions and eyes of ender only eased towards the position the server tracks. The server sends that every 10 ticks for thrown items and every 20 for arrows, so on a server (and in a LAN world) they moved in jerks and cut corners on their arc, which made pearls look like they fly too low. In vanilla these entities keep `Entity`'s no-op interpolation handler: a move packet puts them at the server's position at once, and their own client tick flies them on with gravity and drag until the next update. Now Horizon does the same: - arrows: water drag before the move, air drag (0.99) and gravity (0.05) after it, and a block they reach holds them; - snowballs, eggs, pearls, wind charges, fireballs and the rest: the same `Projectile::tick` the local game uses, with no targets (only the server decides hits); - potions: gravity, drag, move, stop at a block; - eyes of ender: move by their last known motion; motion packets now reach potions and eyes too. The ghast fireball already worked this way; this covers the rest. Fixes #1826 (an arrow stays where it was shot until it lands) and #1762 (eggs, pearls and wind charges hang in the air for a moment after the throw): both are this interpolation towards sparse updates. **A shattered eye of ender had no effect.** The eye that breaks (1 in 5) now sends level event 2003, which draws its item crumbs and the two rings of portal particles. **Potions took a slightly wrong arc.** Thrown potions moved first and applied gravity and drag after. `ThrowableProjectile.tick` applies gravity, then drag (0.8 in water), then moves. ## Vanilla reference - `Entity.moveOrInterpolateTo` with `InterpolationHandler.NO_OP` (only living entities, boats, minecarts, displays, orbs, fishing hooks and shulkers override `createInterpolationHandler`) - `AbstractArrow.tick`, `ThrowableProjectile.tick`, `EyeOfEnder.tick` - `LevelEventHandler` case 2003 ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:13:51 +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#3994
No description provided.