Minecraft – Tellraw command always has the error “Invalid json:”

minecraft-commandsminecraft-java-edition

I am playing with tellraw to tell a message to the player. After solving all the common errors, and the code is correct, the JSON just gives up. I get an Invalid json: message. There is no error, but JSON just tells there's an error, then shows nothing. How can i fix this?

I'm running Minecraft 1.8.9.

The command is /tellraw @p {"LED TV starting":"#2","blue":"#3"}

Best Answer

That command, while valid JSON in itself, makes absolutely no sense in the context of Minecraft.

JSON works by assigning values to specific keys, e.g. the "blue":"#3" in your command assigns a value of "#3" to the key "blue". What happens with the JSON is determined by the interpreter (in this case: Minecraft), which knows how to process certain, specific keys. "blue" and "LED TV starting" are not valid keys in this context, and are simply ignored by the game, hence the error.

An example of valid JSON within the context of Minecraft tellraw would be

{"text":"Hello World!","color":"blue"}

In this case, the keys are "text" and "color", both of which Minecraft knows how to process. There are many more valid keys, such as "bold" or "clickEvent", all of which pose limitations on their values as well (e.g. "color":"banana" doesn't work).

I suggest looking at automated JSON generators like the one on minecraftjson.com and play around a bit. Once you have seen a couple of valid Minecraft JSON, you should be able to understand how they work and creating your own by hand will be much easier (or just keep using a generator forever).