0

Here's the command:

/tellraw @p ["",{"text":"[HINT]","color":"dark_green","bold":true,"clickEvent":{"action":"run_command","value":"/tellraw @p {\"text\":\"This pickaxe cannot break lit glowstone lamps.\",\"color\":\"light_purple\"]"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click For Hint"}]}}}]

That brings up [HINT], which is bold and dark green, and when you hover over it, it says "Click For Hint". The problem is that when you click it, it should activate a tellraw command, however when I click it, I get:

Invalid json: Unterminated object at line 1 column 81

This JSON is flawless (or so I thought). What is wrong?

2
  • You're missing a } near the end, and your first [ doesn't seem to match up. It's easy to see in a coding text editor like Notepad++.
    – MBraedley
    Commented Dec 3, 2015 at 22:53
  • @MBraedley I'm not quite seeing it. If you could leave an answer with the incorrect syntax bolded, I'd really appreciate it
    – David
    Commented Dec 3, 2015 at 23:00

3 Answers 3

2

I was an idiot, and made 1 small mistake that changed everything. Here was the full command:

/tellraw @p ["",{"text":"This map is based off of 1.9 features such as detecting when you pick up items,","color":"green"},{"text":" [HINT] ","color":"dark_green","bold":true,"clickEvent":{"action":"run_command","value":"/tellraw @p {\"text\":\"This pickaxe cannot break lit glowstone lamps.\",\"color\":\"light_purple\"}"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click For Hint"}]}}},{"text":"so you may need to think outside of the box for some levels. good Luck!","color":"green"}]

If you will notice, light_purple had a ] after it instead of }. My bad...

2
  • 2
    Can you accept this answer?
    – kit
    Commented Jun 20, 2019 at 8:27
  • 1
    @kit done, sorry I didn't get to this sooner, the question was very dead
    – David
    Commented Jun 22, 2019 at 4:35
1

I have figured it out! try this:

/tellraw @p [{"text":"[HINT]","color":"dark_green","bold":"true","clickEvent":{"action":"run_command","value":"/tellraw @p [{\"text\":\"This pickaxe cannot break lit glowstone lamps.\",\"color\":\"light_purple\"}]"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click For Hint"}]}}}]

the true in bold:true was missing the quotes, I had to remove one "}" at the very end because there was one too many and I took out the two quotes at the beginning because they didn't seem like they would do anything. I also switched some of the "}" and "]" in the tellraw command containing the hint.

1
  • 2
    The OP has already answered the question themselves. It doesn't seem helpful to provide another answer that does the same thing. Commented Jun 20, 2019 at 6:38
0

Your command is missing some brackets and braces. Try this instead:

/tellraw @p ["",{"text":"[HINT]","color":"dark_green","bold":true,"clickEvent":{"action":"run_command","value":"/tellraw @p {[\"text\":\"This pickaxe cannot break lit glowstone lamps.\",\"color\":\"light_purple\"]"},"hoverEvent":{"action":"show_text","value":{"text":"","extra":[{"text":"Click For Hint"}]}}}}]

I can't verify that it'll do exactly what you want, but I'm fairly certain I've fixed the syntax error.

1
  • [23:41:06] Invalid json: Unterminated array at line 1 column 298
    – David
    Commented Dec 3, 2015 at 23:41

Not the answer you're looking for? Browse other questions tagged .