Long commands run from a click event are truncated, causing the command to fail.
Steps to Reproduce:
1.type following command in a command block:
/tellraw @a {"text":"Press to give ","color":"blue","extra":[{"text":"Click","clickEvent":{"action":"run_command","value":"/effect @a 1 30 4"}},{"text":"sec","color":"red","clickEvent":{"action":"run_command","value":"/give @a iron_sword 1 0 {ench:[{id:32,lvl:3}],display:{Name:Blade of Glory,Lore:[Hello this is Lore,This is a good weapon,I'm trying to find if there is a limit on the length of a command]}}"}}]}
2. power command block
3. click the red word "sec" in the chat.
This produces the error:
Data tag parsing failed: Unbalanced brackets:
{ench:[{id:32,lvl:3}],display:{Name:Blade of Glory,Lore:[Hello this is Lore,
Linked issues
is duplicated by 4
Comments 32
Confirmed. Even happens with the correct command:
/tellraw @a {"text":"Press to give ","color":"blue","extra":[{"text":"Click","clickEvent":{"action":"run_command","value":"/effect @a 1 30 4"}},{"text":"sec","color":"red","clickEvent":{"action":"run_command","value":"/give @a 267 1 0 {ench:[{id:32,lvl:3}],display:{Name:\"Blade of Glory\",Lore:[\"Hello this is Lore\",\"This is a good weapon\",\"I'm trying to find if there is a limit on the length of a command\"]}}"}}]}
It also does the same thing for this command
tellraw @a {text:"<Dragon Slayer> Click ",extra:[{text:"here",color:gold,bold:true,clickEvent:{action:run_command,value:'/give @p 261 1 0 {ench:[{id:48,lvl:127},{id:51,lvl:1}],display:{Name:"Dragon Begon",Lore:[The bow forged from the blood of a dragon.]}}'}},{text:" to get the bow forged from dragon blood."}]}
Then gives the error and puts me on the multiplayer menu
Confirmed as well. It's likely because what's being issued through the 'run_command' action is being run through the player themselves. Having a shorter /tellraw command within the run_command value allows it to work. The command blocks don't have a character limit, but players do.
I think it would be easy to detect if is was sent by a command, but I'm not a Java programmer, so I'm not sure. I hope they fix this soon, because I would really like nested /tellraw commands that don't kick me from the game.
The run_command tag in tellraw is used to define commands that are sent through the games chat system when a player clicks that component in the chat window. This command has the same limitations as any command typed into the chat directly.
One solution to make the example work is using the /trigger command.
We speak about the run_command, not the suggest_command. suggest_command display the command in chat, so it's normal to limit the size. But I don't understand why the lenght should be limited with run_command. The biggest problem is with book: there are the same problem: many users report to me the problem with my book generator: command run from a book are also limited, so it's very difficult to make commands book with this limitation.
Confirmed, was able to reproduce this in 13w37b.