Skip to content

fix(players): decode signed actor IDs in the player list - #458

Merged
RaphiMC merged 1 commit into
ViaVersionAddons:mainfrom
StackAnvil:stackanvil/0060-decode-signed-player-list-actor-ids
Oct 19, 2026
Merged

RaphiMC merged 1 commit into
ViaVersionAddons:mainfrom
StackAnvil:stackanvil/0060-decode-signed-player-list-actor-ids

Conversation

@AlexProgrammerDE

Copy link
Copy Markdown
Collaborator

What this changes

PlayerListAddEntry uses compressed ActorUniqueID, a signed 64-bit value in the Bedrock 1.26.51 protocol-2193 schema. Decode its ZigZag representation consistently with StartGame instead of retaining the unsigned wire value.

The private protocol-2193 skin relay exposed the mismatch: a spawned actor with ID 1 appeared in PlayerListStorage under ID 2. Live skin changes could not resolve the local UUID, and scoreboard associations could resolve another actor. Gophertunnel emits signed IDs as specified by the native schema.

Evidence: https://github.com/Mojang/bedrock-protocol-docs/blob/v1.26.51/json/PlayerListAddEntry.json and https://github.com/Mojang/bedrock-protocol-docs/blob/v1.26.51/json/ActorUniqueID.json

This PR contains one patch from StackAnvil's viabedrock stack, applied alone to the pinned upstream base.

Review focus

Replace the unsigned decoder with the existing signed VarLong decoder.
The change affects only the player-list actor ID field.
For example, actor ID 1 previously decoded as 2, so later actor lookups could fail or select another actor.

The protocol 2193 schemas define a compressed signed 64-bit actor ID:

Validation

bun run pr build viabedrock --patch 0060-decode-signed-player-list-actor-ids.patch passes, including compilation and Checkstyle.
The patch applies alone to the pinned upstream base and changes one production line.
The existing skin-relay observation is recorded in the commit body; this preparation did not repeat a live server capture.

PlayerListAddEntry uses compressed ActorUniqueID, a signed 64-bit value in the Bedrock 1.26.51 protocol-2193 schema. Decode its ZigZag representation consistently with StartGame instead of retaining the unsigned wire value.

The private protocol-2193 skin relay exposed the mismatch: a spawned actor with ID 1 appeared in PlayerListStorage under ID 2. Live skin changes could not resolve the local UUID, and scoreboard associations could resolve another actor. Gophertunnel emits signed IDs as specified by the native schema.

Evidence: https://github.com/Mojang/bedrock-protocol-docs/blob/v1.26.51/json/PlayerListAddEntry.json and https://github.com/Mojang/bedrock-protocol-docs/blob/v1.26.51/json/ActorUniqueID.json
@RaphiMC
RaphiMC merged commit a658bb6 into ViaVersionAddons:main Oct 19, 2026
1 check passed
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.

3 participants