mojira.dev
MC-298155

Dialog command_template using a multiline text input causes player to be kicked out of the server due to illegal characters in chat (which is \n)

Problem:

With the new added feature of allowing multi-line text input, command_template submit action in dialog can now make players to have illegal characters such as “\n“ in their chat input box. This causes the player to be kicked out of the server and it also stops data pack to capture any multiline input.

Expected:

  1. Players should not be kicked out of the server due to a command_template with a multiline text input

  2. It should be possible to store or receive the a multiline text input using commands or data packs

To Recreate:

  1. Execute command:

dialog show @a {type:"minecraft:multi_action_input_form",title:"bug test",inputs:[{type:"text",key:"test",label:"test",initial:"",multiline:{height:180}},],actions:[{id:"done",label:"Done",on_submit:{type:"command_template",template:"data modify storage foo:bar test set value '$(test)'"}}]}
  1. Input any multiline text

  2. Click "Done” to submit input, click confirm again in the pop up to give elevated permissions that run the data command.

Comments 4

Can confirm in 25w21a.

If in the Dialog JSON, in the command template, there is “\n”, it cause crash.
If the player write multiple lines and submit, it cause crash.
But if the player just write “\n”, it don’t cause crash

I tried with tellraw command

in template command

And, when we crash, the command in command template isn’t executed

Dahesor

boq

Plausible

Platform

Normal

Commands, Data Packs

25w21a

1.21.6 Pre-Release 2

Retrieved