I tried to create a tellraw command, which when you click it, makes you execute another tellraw command with yet another clickEvent.
This is the command which I've used:
tellraw @a {text:'click here to create a tellraw button which makes you say hi',
clickEvent:{action:run_command,value:"tellraw @a {text:
'click here to say hi',clickEvent:{action:run_command,value:'say hi'"}}}}
Note that I used two different apostrofes (' and ") to make sure it doesn't missmatch, I thought that would cause problems, but it didn't make the command work.
This is what the command block is outputting:
Invalid json: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 197
I honestly think its a bug, because I'm 99% sure I got the syntax right. If not, tell me! 😃
Comments 4
It was...
" needs to be moved over two }
/ needs to be added before each player-issued command.
tellraw @a {text:'click here to create a tellraw button which makes you say hi',clickEvent:{action:run_command,value:"/tellraw @a {text:'click here to say hi',clickEvent:{action:run_command,
value:'/say hi'}}"}}
Indented
tellraw@a{
text: 'clickheretocreateatellrawbuttonwhichmakesyousayhi',
clickEvent: {
action: run_command,
value: "/tellraw @a {
text:'click here to say hi',
clickEvent:{
action:run_command,value:'/say hi'
}
}"
}
}
what might be the problem is when you click the first message, the entire tellraw command doesn't fit in your chat, because chat is limited to 100 characters
Just FYI what you have above is definitely malformed.
{action:run_command,value:'say hi'"}However I'm running into issues with nested tellraw, answer is probably right in front of me. I'll poke at it a bit more.