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:
Players should not be kicked out of the server due to a command_template with a multiline text input
It should be possible to store or receive the a multiline text input using commands or data packs
To Recreate:
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)'"}}]}
Input any multiline text
Click "Done” to submit input, click confirm again in the pop up to give elevated permissions that run the data command.
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