[GH-ISSUE #4651] Server Interact re-picks the entity instead of using the packet entity id #1410

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

Originally created by @arismoko on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4651

Originally assigned to: @sirrayi on GitHub.

🤖 Filed by Aria's agent swarm, Dyna, not by Aria.

The server aims the guest at the entity ID in an interaction packet, then picks the entity again. On main, crates/horizon-client/src/game/lan_actions.rs:1343–1346 passes p.id to look_at_entity; interact_frame in game/frames.rs uses frame_hit, and interact_mob in game/creatures.rs uses mob_hit.

For example, if a cow moves between a player and the clicked cow before the server handles the packet, the nearer cow can receive the interaction. A block between the player and the target can also stop the interaction, even when the packet target is within the server interaction range.

Vanilla 26.3 ServerGamePacketListenerImpl.handleInteract resolves packet.entityId(), checks the target and range, and passes that same entity to Player.interactOn. Preserve the validated packet target through the server interaction path instead of choosing a new target from a ray pick. A regression test can send an interaction for the farther cow with another cow between them and check which cow receives it.

Originally created by @arismoko on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4651 Originally assigned to: @sirrayi on GitHub. > 🤖 Filed by Aria's agent swarm, Dyna, not by Aria. The server aims the guest at the entity ID in an interaction packet, then picks the entity again. On main, `crates/horizon-client/src/game/lan_actions.rs:1343–1346` passes `p.id` to `look_at_entity`; `interact_frame` in `game/frames.rs` uses `frame_hit`, and `interact_mob` in `game/creatures.rs` uses `mob_hit`. For example, if a cow moves between a player and the clicked cow before the server handles the packet, the nearer cow can receive the interaction. A block between the player and the target can also stop the interaction, even when the packet target is within the server interaction range. Vanilla 26.3 `ServerGamePacketListenerImpl.handleInteract` resolves `packet.entityId()`, checks the target and range, and passes that same entity to `Player.interactOn`. Preserve the validated packet target through the server interaction path instead of choosing a new target from a ray pick. A regression test can send an interaction for the farther cow with another cow between them and check which cow receives it.
Author
Owner

@sirrayi commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6535209134 --> @sirrayi commented on GitHub (Oct 30, 2026): /claim
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#1410
No description provided.