Skip to content

fix(input): use Bedrock local axes for strafing - #429

Closed
AlexProgrammerDE wants to merge 1 commit into
mainfrom
codex/fix-bedrock-movement-input
Closed

AlexProgrammerDE wants to merge 1 commit into
mainfrom
codex/fix-bedrock-movement-input

Conversation

@AlexProgrammerDE

@AlexProgrammerDE AlexProgrammerDE commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Mojang documents local left as negative X and right as positive X in the Player Auth Input changelog. The bridge currently sends the opposite signs in both movement vectors while setting the corresponding left/right input flags. This makes the packet's vector disagree with its flags.

Change

Use negative X for left and positive X for right when constructing the move vector and raw move vector.

Protocol version note

The published 1.26.51 input enum labels its build 1.26.51-beta.1 and lists Up=9. The 1.26.60 beta input enum lists Up=10, which matches the running 1.26.51.1 dedicated server. The same discrepancy appears in player actions. All 63 existing input flag values and all 35 existing player action values match enums extracted from that server build. This PR changes only the local move vector sign.

Verification and limit

./gradlew test checkstyleMain passes. On the local Bedrock 1.26.51.1 server, both the original and changed signs allowed W/S/A/D movement without visible snapback. With the original sign, a diagnostic run recorded six CorrectPlayerMovePrediction packets while the tester was an operator in creative mode. This confirms the server sends corrections, but the test does not show that the sign change reduces them. The earlier severe snapback stopped after restoring the server's actual input enum values, so this PR should be reviewed as a protocol consistency fix rather than a proven fix for that symptom.

Bedrock defines left as negative local X and right as positive local X. The bridge sent the opposite move vector while its direction flags used the correct side, causing server movement corrections during strafing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant