I'm trying to do the /tellraw
command. I know how but I want to know how to make text with more than one color and with click events.
3 Answers
The extra
list holds "extra" text components that you can stylize:
/tellraw @a {"text":"","extra":[{"text":"blue","color":"blue"},{"text":"green","color":"green"}]}
Note that they will inherit from the parent. For example, everything inside extra
will be bold unless set to false for specific components:
/tellraw @a {"text":"All bold","bold":true,"extra":[{"text":"blue","color":"blue"},{"text":"green","color":"green"}]}
You can instantiate as a list to essentially start within extra
, saving on characters. If doing so, the very first record listed will act as the root parent:
/tellraw @a [{"text":"blue","color":"blue"},{"text":"green","color":"green"}]
/tellraw @a [{"text":"All bold","bold":true},{"text":"blue","color":"blue"},{"text":"green","color":"green"}]
-
-
also thx for editing it to make it sound better :D Commented Mar 17, 2016 at 19:49
You can use tellraw (and other JSONish commands as /title etc) command generator, located here: Minecraft JSON generator
You can pick colors from color picker and add text pieces as you need. It also has preview visible when you add new parts of text. You can also choose the styles and click events for each piece of text.
Look at the outputted code for learning how added pieces of text influence the command.
Don't forget to use commandblock for too long commands. Enjoy.
If you are using MCBE, use these following commands:
/tellraw @a {"rawtext":[{"text":"Example Text"}]}
If you want to make command outputs, use:
/tellraw @a {"rawtext":[{"translate":"commands.(command).success","with":["1","2","3","4"]}]}
Get more info at https://minecraft.wiki/w/Commands/tellraw#Bedrock_Edition.2FPocket_Edition