1

Why is this not working?

YoussofHD's Avatar YoussofHD6/17/15 9:33 pm
1 emeralds 340 6
6/19/2015 9:17 pm
Snowyfox's Avatar Snowyfox
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.
Posted by YoussofHD's Avatar
YoussofHD
Level 1 : New Miner
0

Create an account or sign in to comment.

6

1
06/19/2015 2:18 pm
Level 52 : Grandmaster Pixel Painter
craftykids
craftykids's Avatar
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
06/19/2015 5:51 pm
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
Why do people not tell me this sort of stuff earlier ;-;, so usefull
1
06/19/2015 9:17 pm
Level 26 : Expert Princess
Snowyfox
Snowyfox's Avatar
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.
1
06/19/2015 11:27 am
Level 57 : Grandmaster Cyborg
Pepijn
Pepijn's Avatar
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
06/17/2015 9:57 pm
Level 52 : Grandmaster Pixel Painter
craftykids
craftykids's Avatar
Remove the last two brackets:
/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
06/17/2015 10:17 pm
Level 1 : New Miner
YoussofHD
YoussofHD's Avatar
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?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome