Sends a JSON message to players.
Syntax
- Java Edition
tellraw <targets> <message>
- Bedrock Edition
tellraw <target: target> <raw json mess
age: json>
Arguments
JE: <targets>: entity
BE: target: target: CommandSelector<Player>
- Must be a player name, a target selector or a UUID[Java Edition only]. And the target selector must[JE only]/should[BE only] be of player type.
- Specifies the player(s) to send the message to.
JE: <message>: component
BE: raw json message: json: Json::Value
- Must be a raw JSON text.
- Specifies the message to send.
Result
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| any | the arguments are not specified correctly | Unparseable | Failed |
if <targets> or player: target fails to resolve to one or more online players | Failed | ||
| Otherwise | Displays message to the targeted player(s). | ||
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
- To send the message "Hello" in chat:
/tellraw @a "Hello"
- To send the message "I am red" colored red in chat:
/tellraw @a {"text":"I am red","color":"red"}
- To send a message containing the text "Red" in red and "Blue" in blue:
/tellraw @a [{"text":"Red ","color":"red"},{"text":"Blue","color":"blue"}]
- To send the message "Hover me!" in chat, which displays the text "Hi!" when hovered over:
/tellraw @a {"text":"Hover me!","hoverEvent":{"action":"show_text","value":"Hi!"}}
- To send the magenta message "Hover me again!" in chat, which displays the red text "Red Title" when hovered over:
/tellraw @a {"text":"Hover me again!","color":"#ff00ff","hoverEvent":{"action":"show_text","value":{"text":"Red Title","color":"#ff0000"}}}
- To send the message "Diamond Axe" in chat, colored turqouise, with an unbreakable diamond axe showing when the text is hovered over:
/tellraw @a {"text":"Diamond Axe","color":"#00ff88","hoverEvent":{"action":"show_item","contents":{"id":"diamond_axe","count":3,"tag":"{Unbreakable:1}"}}}
- To send the message "Your Score is: " with the score for the object "object_name" of the player or entity who executed the command.
/tellraw @s [{"text":"Your Score Is: "},{"score":{"name":"@s","objective":"object_name"}}]
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. | |||
| Bedrock Edition | |||||
| 1.9.0 | beta 1.9.0.0 | Added /tellraw. | |||