[PR #2976] [MERGED] Tick thrown tridents on a server, so they fly, hit, stick and return in single player #4730

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

📋 Pull Request Information

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

Base: main ← Head: fix/2756-thrown-trident-frozen


📝 Commits (2)

  • 5dd3bf0 Tick thrown tridents on a server that has no player of its own
  • 09043cd trident: only the owner picks up its trident while the owner is in the level

📊 Changes

2 files changed (+114 additions, -29 deletions)

View changed files

📝 crates/horizon-client/src/game/lan_entities.rs (+6 -3)
📝 crates/horizon-client/src/game/trident.rs (+108 -26)

📄 Description

What and why

Single player runs as a client of an in-process server, and that server has no player of its own. tick_tridents quit at once when there was no local player, so a trident a player threw was never moved by the server: it stayed where it was thrown, never hit a mob, never stuck in a block and never came back with Loyalty. The client only drew it where the server said (and, since #2356, flew it on by itself), so it looked frozen or went through everything.

  • tick_tridents no longer needs the local player. Loyalty finds the owner among this level's players (the thrower, a guest, or this game's player) and returns the trident to that player's eye. A trident whose owner is not in the level is not pulled back, as getOwner() == null in vanilla.
  • A landed or returning trident is picked up by any player touching it, guests included (it was only ever picked up by this game's player). The item goes into that guest's inventory and the clients get TakeItemEntity.
  • The spawn packet of a trident carries the thrower's entity id (it was always the host's, 0 on a server), so the thrower's client can pull a Loyalty trident home between server updates.

Vanilla reference

  • ThrownTrident.java:63 (tick: Loyalty only with an owner, pulled to the owner's eye)
  • AbstractArrow.java:637 (playerTouch, tryPickup), ThrownTrident.java:171
  • Projectile.java:385 (getAddEntityPacket: the owner's id)

Self-check

clippy and fmt pass for horizon-client. Not run in game.
Fixes #2756


🔄 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/2976 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/2756-thrown-trident-frozen` --- ### 📝 Commits (2) - [`5dd3bf0`](https://github.com/horizon-rust/horizon/commit/5dd3bf02d38f5b26b64e7eace19def636e5791f6) Tick thrown tridents on a server that has no player of its own - [`09043cd`](https://github.com/horizon-rust/horizon/commit/09043cd199cb21bf0c022c1939193d7409812d39) trident: only the owner picks up its trident while the owner is in the level ### 📊 Changes **2 files changed** (+114 additions, -29 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/lan_entities.rs` (+6 -3) 📝 `crates/horizon-client/src/game/trident.rs` (+108 -26) </details> ### 📄 Description ## What and why Single player runs as a client of an in-process server, and that server has no player of its own. `tick_tridents` quit at once when there was no local player, so a trident a player threw was never moved by the server: it stayed where it was thrown, never hit a mob, never stuck in a block and never came back with Loyalty. The client only drew it where the server said (and, since #2356, flew it on by itself), so it looked frozen or went through everything. - `tick_tridents` no longer needs the local player. Loyalty finds the owner among this level's players (the thrower, a guest, or this game's player) and returns the trident to that player's eye. A trident whose owner is not in the level is not pulled back, as `getOwner() == null` in vanilla. - A landed or returning trident is picked up by any player touching it, guests included (it was only ever picked up by this game's player). The item goes into that guest's inventory and the clients get `TakeItemEntity`. - The spawn packet of a trident carries the thrower's entity id (it was always the host's, 0 on a server), so the thrower's client can pull a Loyalty trident home between server updates. ## Vanilla reference - `ThrownTrident.java:63` (`tick`: Loyalty only with an owner, pulled to the owner's eye) - `AbstractArrow.java:637` (`playerTouch`, `tryPickup`), `ThrownTrident.java:171` - `Projectile.java:385` (`getAddEntityPacket`: the owner's id) ## Self-check clippy and fmt pass for horizon-client. Not run in game. Fixes #2756 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:32 +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#4730
No description provided.