PaperMC / PaperMC/Paper

dialog action commands longer than the chat limit disconnects the player

Open
#14,212 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

You run the command and it sets the player head texture to the texture you want

Observed/Actual behavior

You are kicked from the server with error:

lost connection: Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'serverbound/minecraft:chat_command'
Steps/models to reproduce
dialog show @p {"type":"minecraft:multi_action","title":
        {"text":"Set Texture"},"inputs":[
            {"type":"minecraft:text","key":"value","max_length":200,"label":{"text":"Text"}}
        ],"actions":[
          {"label":{"text":"Apply Texture"},"action":{"type":"minecraft:dynamic/run_command",
            "template":"item modify entity @s weapon.mainhand {function:\"minecraft:set_components\",components:{\"minecraft:profile\":{properties:[{\"name\":\"textures\",\"value\":\"$(value)\"}]}}}"
          }}
        ],"exit_action":{"label":{"text":"Cancel"}}}
  1. copy the code above into a command block
  2. put a blank player head in your main hand
  3. trigger the command block
  4. enter this in the box: eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzIyODYzMjRiNmIwNmMyZDRjMWQ4ZjgzYTliMTQwZDdjYWJkODI4MWRiOTcyYjI0M2QyZTYyZDFhMjNkMDA1NCJ9fX0=
  5. press the Apply Texture button
  6. observe that you are kicked from the server.

Next thing to try:

  • try steps 1-5 on a vanilla minecraft server with no paper installed
  • observe that it works and sets your player head with no error
Plugin and Datapack List

None

Paper version

paper-26.2-117

Other

The following code can be ran to show that below the limit, the dialogs do indeed run correctly in Paper normally.

dialog show @p {"type":"minecraft:multi_action","title":
        {"text":"Set Custom Name"},"inputs":[
            {"type":"minecraft:text","key":"value","max_length":500,"label":{"text":"Text"}}
        ],"actions":[
          {"label":{"text":"Apply Name"},"action":{"type":"minecraft:dynamic/run_command",
            "template":"item modify entity @s weapon.mainhand {function:\"minecraft:set_components\",components:{\"minecraft:custom_name\":{\"text\":\"$(value)\"}}}"
          }}
        ],"exit_action":{"label":{"text":"Cancel"}}}

I suspect that the dialog may be sending packets that are counted as invalid when they are valid on a vanilla minecraft server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied dialog command on Paper and vanilla, comparing the serverbound/minecraft:chat_command decoding path. Trace how the long dynamic/run_command action is validated, then verify that the texture dialog completes without disconnecting while the shorter custom-name example remains working.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.