Skip to content

fix: send a command with no signable argument as chat_command - #1525

Open
u9g wants to merge 1 commit into
PrismarineJS:masterfrom
u9g:fix/unsigned-command-without-signable-args
Open

fix: send a command with no signable argument as chat_command#1525
u9g wants to merge 1 commit into
PrismarineJS:masterfrom
u9g:fix/unsigned-command-without-signable-args

Conversation

@u9g

@u9g u9g commented Sep 7, 2026

Copy link
Copy Markdown
Member

Constraints on the serverbound command packet:

  • chat_command_signed is written only when the command produced at least one argument signature.
  • A command with no signable argument (/login, /list, anything the server's command tree does not mark as a message argument) is written as chat_command, whether or not the client can sign.
  • The signature list carried by the packet is the one the command produced.

Vanilla reference: ClientPacketListener.sendCommand sends the unsigned ServerboundChatCommandPacket when SignableCommand.of(...).arguments() is empty.

Tests: /login hunter2 and an argumentless /msg write chat_command with an empty signature list. Both fail on master and pass with the change. They do not run in CI yet; #1526 makes this file run and #1527 fixes the pre-existing test in it.

_signedChat chose chat_command_signed whenever the client had profile
keys and a chat session, regardless of the command. The vanilla client
picks the packet per command: ClientPacketListener.sendCommand sends the
unsigned ServerboundChatCommandPacket when SignableCommand.of(...)
.arguments() is empty, and only sends the signed packet when there is an
argument to sign. Every argumentless command (/login, /list, and any
command the server's command tree does not mark as a message argument)
went out on the signed packet with an empty signature list.

The packet now follows the signatures actually produced.
@u9g
u9g force-pushed the fix/unsigned-command-without-signable-args branch from 93043f8 to 1aca229 Compare September 7, 2026 01:03
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