Skip to content

Fix pc/26.1 client_command actionId: plain varint, not a mapper - #1284

Open
u9g wants to merge 1 commit into
PrismarineJS:masterfrom
u9g:fix/26-1-client-command-varint
Open

Fix pc/26.1 client_command actionId: plain varint, not a mapper#1284
u9g wants to merge 1 commit into
PrismarineJS:masterfrom
u9g:fix/26-1-client-command-varint

Conversation

@u9g

@u9g u9g commented Sep 9, 2026

Copy link
Copy Markdown
Member
  • packet_client_command.actionId in pc/26.1 is a varint, as in every other pc protocol.json (1.9 through 1.21.11).
  • The wire format is unchanged: vanilla 26.1 writes the Action enum ordinal (writeEnum), so 0 = perform_respawn, 1 = request_stats, 2 = request_gamerule_values.
  • A client that writes actionId: 0 serializes on 26.1; with the mapper it threw SizeOf error for undefined : 0 is not in the mappings value, the serializer stream errored and the server timed the connection out (disconnect.timeout).

Verified against a local vanilla 26.1 server: /kill on a mineflayer bot now ends in a clean auto-respawn (health 20, alive, no serializer error). The protocol passes protodef-validator with the repo's extra types.

Sibling of #1278, which does the same for use_entity.hand, the only other 26.1-only mapper in toServer.

The vanilla packet writes the Action enum ordinal (writeEnum) on 26.1 exactly as on 1.21.11, and pc/26.1 is the only protocol.json that declares the field as a mapper. The strict compiled mapper (node-protodef PrismarineJS#176) throws on the numeric id every client writes, so the auto-respawn after death errors the serializer stream and the server times the connection out.
@extremeheat

Copy link
Copy Markdown
Member

Seems like this should be other way around. Is it a fixed enum or variable field ?

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.

2 participants