[GH-ISSUE #5935] Anticheat prediction: honest sprinting players flagged 0.045 off after a quick sprint restart #1890

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

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

Originally assigned to: @ludovic111 on GitHub.

🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself.

What happens. On the official server, the prediction check logs honest players running on flat ground: about 200 lines in 40 minutes, from many different players. All of them look like this: 1 tick, ground sprinting, keys forward sprint (sometimes with left or right), an offset of about 0.045 blocks along the direction of motion, and moved 0.25–0.28, a normal sprint. Some lines show 0.030 or 0.054 instead.

Cause. The offsets match the replay accelerating at walking speed instead of sprint speed: 0.0294 too short on the first tick (under the 0.03 tolerance), then 0.0294 × (1 + 0.546) = 0.0455 on the second, and 0.054 on a third. The replay keeps the sprint flag but loses the sprint speed modifier, while the client keeps it:

  1. The client stops sprinting for a tick and then starts again. STOP_SPRINTING and START_SPRINTING reach the server in two different server ticks.
  2. For the STOP, the server sends the player its own shared flags (sprinting bit cleared) and its movement speed without the minecraft:sprinting modifier. They reach the client after it is already sprinting again.
  3. The client (vanilla's ClientPacketListener, and Horizon's the same way) takes both. In its next LocalPlayer.aiStep, canStartSprinting() is true again because the flag is clear. With the sprint key held it calls setSprinting(true), which adds the modifier back. wasSprinting never changed, so it sends nothing.
  4. The replay applies the attributes (Change::Attributes { sprint: Some(false) }) but never sees the flag. It goes on "sprinting" without the modifier until the START's attributes reach it, one or two ticks later.

Fix. Record the sprinting bit of the shared flags the server sends the player (Change::Sprinting) and apply it to the replay's flag alone, the way assignValues does. The replay's sprint phase then starts the sprint again with its modifier, as the client did.

Originally created by @ludovic111 on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5935 Originally assigned to: @ludovic111 on GitHub. > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. **What happens.** On the official server, the prediction check logs honest players running on flat ground: about 200 lines in 40 minutes, from many different players. All of them look like this: `1 tick`, `ground sprinting`, `keys forward sprint` (sometimes with left or right), an offset of about 0.045 blocks along the direction of motion, and `moved` 0.25–0.28, a normal sprint. Some lines show 0.030 or 0.054 instead. **Cause.** The offsets match the replay accelerating at walking speed instead of sprint speed: 0.0294 too short on the first tick (under the 0.03 tolerance), then 0.0294 × (1 + 0.546) = 0.0455 on the second, and 0.054 on a third. The replay keeps the sprint flag but loses the sprint speed modifier, while the client keeps it: 1. The client stops sprinting for a tick and then starts again. STOP_SPRINTING and START_SPRINTING reach the server in two different server ticks. 2. For the STOP, the server sends the player its own shared flags (sprinting bit cleared) and its movement speed without the `minecraft:sprinting` modifier. They reach the client after it is already sprinting again. 3. The client (vanilla's `ClientPacketListener`, and Horizon's the same way) takes both. In its next `LocalPlayer.aiStep`, `canStartSprinting()` is true again because the flag is clear. With the sprint key held it calls `setSprinting(true)`, which adds the modifier back. `wasSprinting` never changed, so it sends nothing. 4. The replay applies the attributes (`Change::Attributes { sprint: Some(false) }`) but never sees the flag. It goes on "sprinting" without the modifier until the START's attributes reach it, one or two ticks later. **Fix.** Record the sprinting bit of the shared flags the server sends the player (`Change::Sprinting`) and apply it to the replay's flag alone, the way `assignValues` does. The replay's sprint phase then starts the sprint again with its modifier, as the client did.
bsakaguchi 2026-11-02 15:50:24 +07:00
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6558211919 --> @ludovic111 commented on GitHub (Nov 1, 2026): 🤖 Agent: /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#1890
No description provided.