Here is the command I am trying to get working:
/tellraw @a {text:"1.Rules & Requirements",bold:true,color:red,clickEvent:{action:"run_command",value:"/tp @a -11 22 5"},hoverEvent:{action:"show_text",value:"Teleport to Rules & Requirements!"}}]}
And here is what the error is:
[22:30] Invalid json: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 185
The goal is that when the player is at specific coordinates then this message would appear in chat "1.Rules & Requirements" and when they click on it, it would teleport them to -11 22 5 but if they hover over the text it should say "Teleport to Rules & Requirements."
What am I doing wrong? I have a command block which tests for a player in a certain coordinates that is hooked up to 2 other command block chains which work fine except for this one. What is the error? Any help would be appreciated.
/tellraw @a {text:"1.Rules & Requirements",bold:true,color:red,clickEvent:{action:"run_command",value:"/tp @a -11 22 5"},hoverEvent:{action:"show_text",value:"Teleport to Rules & Requirements!"}}]}
And here is what the error is:
[22:30] Invalid json: Use JsonReader.setLenient(true) to accept malformed JSON at line 1 column 185
The goal is that when the player is at specific coordinates then this message would appear in chat "1.Rules & Requirements" and when they click on it, it would teleport them to -11 22 5 but if they hover over the text it should say "Teleport to Rules & Requirements."
What am I doing wrong? I have a command block which tests for a player in a certain coordinates that is hooked up to 2 other command block chains which work fine except for this one. What is the error? Any help would be appreciated.
Create an account or sign in to comment.
6
1
To put the second button on a different line, you can use the newline character, which is represented by "\n"
/tellraw @a "This is on one line.\nThis is on another."
1
Why do people not tell me this sort of stuff earlier ;-;, so usefull
1
I thought escape characters only function on programming languages.
Yes, I know they're global, and I know Minecraft is a Java game, but I
didn't expect it to support escape characters. lol.
Yes, I know they're global, and I know Minecraft is a Java game, but I
didn't expect it to support escape characters. lol.
1
YoussofHD
If I wanted to add a second button to press that goes below can I use the same command block? (Example: "start" in green). Or will I need a second command block?
In theory you can add it to the existing command, but if you want this button to always appear on the next line I would suggest using a second command.
You or others might think: "If I want it on another line, why not use a lot of spaces to force it on the next line?" The answer is that the amount of character before text moves to a different line depends on the resolution of the screen and the scale of the chatbox. So whatever looks good in your minecraft, will probably look horribly for someone else.
1
Remove the last two brackets:
Although you should probably use "@p" instead of the second "@a," because @a will teleport everyone.
/tellraw @a {text:"1.Rules & Requirements",bold:true,color:red,clickEvent:{action:"run_command",value:"/tp @a -11 22 5"},hoverEvent:{action:"show_text",value:"Teleport to Rules & Requirements!"}}
Although you should probably use "@p" instead of the second "@a," because @a will teleport everyone.
/tellraw @a {text:"1.Rules & Requirements",bold:true,color:red,clickEvent:{action:"run_command",value:"/tp @p -11 22 5"},hoverEvent:{action:"show_text",value:"Teleport to Rules & Requirements!"}}
1
Thanks for your help!! Also, the map I am making is meant for single player so I don't think it will matter if I use @p or @a considering it is a single player map. Correct me if I'm wrong.
Edit: If I wanted to add a second button to press that goes below can I use the same command block? (Example: "start" in green). Or will I need a second command block?
Edit: If I wanted to add a second button to press that goes below can I use the same command block? (Example: "start" in green). Or will I need a second command block?