/tellraw
< Commands
Not to be confused with Commands/msg or Commands/say.
This article is about the command that sends JSON messages. For the command to whisper, see Commands/tell.
/tellraw| Permission level required |
|
|---|---|
| Restrictions |
None |
{
"title": "<code>/tellraw</code>",
"rows": [
{
"field": "\n* 2 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Sends a JSON message to players.
Syntax
- Java Edition
tellraw <targets> <message>
- Bedrock Edition
tellraw <target: target> <raw json message: json>
Arguments
JE: <targets>: entity
BE: target: target: CommandSelector<Player>
- Specifies the player(s) to send the message to.
- Must be a player name, a target selector or a UUID. And the target selector must/should be of player type. In Bedrock Edition, the target selector should be of player type.
JE: <message>: component
BE: raw json message: json: Json::Value
- Specifies the message to send.
- In Java Edition, must be a valid text component. In Bedrock Edition, must be a JSON [NBT Compound / JSON Object]Object.
Result
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable | Unparseable |
raw json message: json is not a raw JSON text. | N/A | Failed | |
player: target is a target selector that is not in player type. | |||
<targets> or player: target fails to resolve to one or more online players. | Failed | ||
| Otherwise | Successful | ||
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
| On success | 1 | 1 | the number of targeted players | ||
| Bedrock Edition | On fail | 0 | N/A | N/A | |
| On success | 1 | N/A | N/A |
Examples
| Java Edition | Bedrock Edition | |||
|---|---|---|---|---|
| To send the message "Hello" in chat: | /tellraw @a "Hello"
|
/tellraw @a {"rawtext":[{"text":"Hello"}]}
| ||
| To send the message "I am blue" colored blue in chat: | /tellraw @a {"text":"I am blue","color":"blue"}
|
/tellraw @a {"rawtext":[{"text":"§bI am blue"}]}
| ||
| To send the message "Hover me!" in chat, which displays the text "Hi!" when hovered over: | /tellraw @a {text:"Hover me!",hover_event:{action:"show_text",value:"Hi!"}}
| |||
| To send the message-colored dark red in chat: |
|
/tellraw @a {"rawtext":[{"text":"§4Y0U G3T B4CK H3R3 N0W"}]}
|
Use '\n' to insert a new line: | /tellraw @a {"text":"Text1\nText2"}
|
| Use '\uE100' to insert a hunger bar emoji: | /tellraw @a {"rawtext":[{"text":"Text1\uE100Text2"}]}
| |||
| Display a message in the Enchantment Table's glyphs: | /tellraw @a {"text":"Hello World","font":"alt"}
|
|
||
| Display a message in the illager runes: | /tellraw @a {"text":"Hello World","font":"illageralt"}
|
|||
| Display a translated string: | /tellraw @p {"translate":"item.minecraft.diamond"}
|
/tellraw @s {"rawtext":[{"translate":"item.diamond.name"}]}
| ||
Simulate the output of , run through a command block:
|
/tellraw @a {"translate":"chat.type.announcement","with":[{"text":"@"},[{"selector":"@p"},{"text":" loves Minecraft!"}]]}
|
History
For changes to the raw JSON text used by this command, see Raw JSON text format § History.
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.7.2 | 13w37a | Added /tellraw. | |||||
| 1.21.5 | 25w02a | Text Components are now specified with SNBT instead of JSON. | |||||
| Bedrock Edition | |||||||
| 1.9.0 | beta 1.9.0.0 | Added /tellraw. | |||||
See also
/say— send a plain text message to all players/tell— send a plain private text message to specific players