Can't set the display name [duplicate]

I'm trying to update the commands on a map to 1.13, every time I try to add a team with /team add Green Creeper Corp it wont accept the display name. I can use /team add Green, but I would like the name of Creeper Corp. I keep getting this error:

Invalid chat component: Use JSONReader.setLenient(true) to accept malformed JSON at line 1 column 2 path $[0] ...add Green [Creeper Corp]<--[HERE]

Is there a way to get it to accept the display name? and if so how?


Solution 1:

1.13 changed how you set display names. They must now be made with a json text component. For example:

team add Green {"text":"Creeper Corp"}

It's better this way, because now you can do stuff to the display name that you previously couldn't do. For example:

team add Green {"text":"Creeper ","color":"green","bold":"true","extra":[{"text":"Corp","color":"gold","italic":"true","underlined":"true"}]}

In the case of /team, you can also use a regular quoted string as a shortcut:

team add Green "Creeper Corp"

Solution 2:

JSON is very picky about input. It expects Strings to be enclosed in "".

You can use /team add Green "Creeper Corp" to add your team.

enter image description here