Updated:
The simplest form
# Java
/tellraw @a {"text":"Game start!","color":"gold","bold":true}
# Bedrock
/tellraw @a {"rawtext":[{"text":"§6§lGame start!"}]}
Java sets color and style as fields. Bedrock puts formatting codes that start with § inside the text.
Colors
| Java color name | Bedrock code | Color |
|---|---|---|
red | §c | Red |
gold | §6 | Gold |
yellow | §e | Yellow |
green | §a | Green |
aqua | §b | Aqua |
blue | §9 | Blue |
light_purple | §d | Pink |
white | §f | White |
gray | §7 | Gray |
Java also accepts hex colors such as "color":"#FF8800". On Bedrock, §l is bold and §r resets formatting.
Different colors in one message
On Java, list several parts in square brackets. The empty "" at the start stops the first part's style from carrying over to the rest.
/tellraw @a ["",{"text":"[Notice] ","color":"yellow"},{"text":"The boss has appeared","color":"red"}]
Player names and scores
# Java
/tellraw @a ["",{"selector":"@p"},{"text":" has coins: "},{"score":{"name":"@p","objective":"money"}}]
# Bedrock
/tellraw @a {"rawtext":[{"selector":"@p"},{"text":" has coins: "},{"score":{"name":"@p","objective":"money"}}]}
Create the objective first with /scoreboard objectives add money dummy. The scoreboard guide explains objectives step by step.
Clickable text (Java)
Clicking the text can run a command or open a URL. The field names changed in Java 1.21.5.
# 1.21.5 and later
/tellraw @p {"text":"[Click to warp]","color":"aqua","click_event":{"action":"run_command","command":"/trigger warp"}}
# 1.21.4 and earlier
/tellraw @p {"text":"[Click to warp]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger warp"}}
Players who are not operators can still use /trigger, so pair click text with it (see the trigger guide). Bedrock tellraw has no click actions.
Tellraw or title?
Use /title for big text in the middle of the screen. Tellraw stays in the chat history, so it suits rules, hints and logs. The title and tellraw guide compares the two.
Common questions
- Accented or non-English letters look broken. Save command block text and data pack files as UTF-8. Text typed straight into chat or a command block normally shows correctly.
- How do I add a line break? Put
\ninside the text. It works on both editions. - How is it different from /say? /say shows "[sender] message" and cannot be colored. Tellraw hides the sender and lets you style everything.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.