Minecraft:Commands/tellraw: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{ | {{MC/Distinguish|Commands/msg|Commands/say}} | ||
{{about|the command that sends JSON messages|the command to whisper|Commands/tell}} | {{about|the command that sends JSON messages|the command to whisper|Commands/tell}} | ||
{{Infobox command | {{Infobox command | ||
| Line 20: | Line 20: | ||
==Arguments== | ==Arguments== | ||
{{ | {{MC/Argument|targets|entity|target: target|CommandSelector<Player>}} | ||
: Specifies the player(s) to send the message to. | : Specifies the player(s) to send the message to. | ||
: {{ | : {{MC/Arg desc|je=entity|amount=multiple|type=players|be=player}} | ||
{{ | {{MC/Argument|message|component|raw json message: json|Json::Value}} | ||
: Specifies the message to send. | : Specifies the message to send. | ||
: {{ | : {{MC/Arg desc|je=component|be=Json::Value}} | ||
==Result== | ==Result== | ||
| Line 40: | Line 40: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0|0}} | {{MC/Output table|edition=je|On fail|0|0|0}} | ||
{{Output table|On success|1|1|the number of targeted players}} | {{MC/Output table|On success|1|1|the number of targeted players}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|1}} | {{MC/Output table|On success|1}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
{{More images|section=true}} | {{MC/More images|section=true}} | ||
{| class="wikitable" | {| class="wikitable" | ||
! | ! | ||
| Line 112: | Line 112: | ||
|[[File:Diamond1.png|alt=Diamond|frameless]] | |[[File:Diamond1.png|alt=Diamond|frameless]] | ||
|- | |- | ||
|Simulate the output of {{ | |Simulate the output of {{MC/Command|say|@p loves Minecraft!}}, run through a command block: | ||
| | | | ||
|<code>/tellraw @a {"translate":"chat.type.announcement","with":[{"text":"@"},[{"selector":"@p"},{"text":" loves Minecraft!"}]]}</code> | |<code>/tellraw @a {"translate":"chat.type.announcement","with":[{"text":"@"},[{"selector":"@p"},{"text":" loves Minecraft!"}]]}</code> | ||
| Line 119: | Line 119: | ||
== History == | == History == | ||
{{ | {{MC/For|changes to the raw JSON text used by this command|Raw JSON text format#History}} | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.7.2|dev=13w37a|Added {{ | |{{HistoryLine||1.7.2|dev=13w37a|Added {{MC/Cmd|tellraw|link=none}}.}} | ||
|{{HistoryLine||1.21.5|dev=25w02a|Text Components are now specified with SNBT instead of JSON.}} | |{{MC/HistoryLine||1.21.5|dev=25w02a|Text Components are now specified with SNBT instead of JSON.}} | ||
}} | }} | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||1.9.0|dev=beta 1.9.0.0|Added {{ | |{{HistoryLine||1.9.0|dev=beta 1.9.0.0|Added {{MC/Cmd|tellraw|link=none}}.}} | ||
}} | }} | ||
==See also== | ==See also== | ||
* {{ | * {{MC/Cmd|say}} — send a plain text message to all players | ||
* {{ | * {{MC/Cmd|tell}} — send a plain private text message to specific players | ||
== External links == | == External links == | ||
| Line 143: | Line 143: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/tellraw | de:Befehl/tellraw | ||
Latest revision as of 20:14, 9 April 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Sends a JSON message to players.
Syntax
- Java Edition
tellraw <targets> <message>
- Bedrock Edition
tellraw <target: target> <raw json message: json>
Arguments
Template:El: <targets>: entity
Template:El: target: target: CommandSelector<Player>
- Specifies the player(s) to send the message to.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <message>: component
Template:El: raw json message: json: Json::Value
- Specifies the message to send.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|component}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of targeted players}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
Examples
| Minecraft:Java Edition | Minecraft:Bedrock Edition | Preview | |
|---|---|---|---|
| To send the message "Hello" in chat: | /tellraw @a "Hello"
|
/tellraw @a {"rawtext":[{"text":"Hello"}]}
|
Hello |
| To send the message "I am blue" colored blue in chat: | /tellraw @a {"text":"I am blue","color":"blue"}
|
/tellraw @a {"rawtext":[{"text":"§9I am blue"}]}
|
I am blue (In 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!"}}
|
Hover me! (Hovered: Hi!) | |
| To send the message-colored dark red in chat: | /tellraw @a {text:"Y0U G3T B4CK H3R3 N0W",color:dark_red}
|
/tellraw @a {"rawtext":[{"text":"§4Y0U G3T B4CK H3R3 N0W"}]}
|
Y0U G3T B4CK H3R3 N0W (Dark red) |
| Use '\n' to insert a new line: | /tellraw @a {text:"Text1\nText2"}
|
/tellraw @a {"rawtext":[{"text":"Text1\nText2"}]}
|
Text1 (newline) Text2 |
| Use '\uE100' to insert a hunger bar emoji: | /tellraw @a {"rawtext":[{"text":"Text1\uE100Text2"}]}
|
||
| Display a message in the Minecraft:Enchanting Table's glyphs: | /tellraw @a {text:"Hello World",font:alt}
|
⍑ᒷꖎꖎ𝙹 ∴𝙹∷ꖎ↸ | |
| Display a message in the Minecraft:illager runes: | /tellraw @a {"text":"Hello World","font":"illageralt"}
|
Hello World (illager runes) | |
| Display a translated string: | /tellraw @p {"translate":"item.minecraft.diamond"}
|
/tellraw @s {"rawtext":[{"translate":"item.diamond.name"}]}
|
Diamond |
| Simulate the output of Script error: No such module "command"., run through a command block: | /tellraw @a {"translate":"chat.type.announcement","with":[{"text":"@"},[{"selector":"@p"},{"text":" loves Minecraft!"}]]}
|
History
Java Edition
Bedrock Edition
See also
- REDIRECT Template:Command
Template:Redr — send a plain text message to all players
- REDIRECT Template:Command
Template:Redr — send a plain private text message to specific players
External links
de:Befehl/tellraw es:Comandos/tellraw ja:コマンド/tellraw pt:Comandos/tellraw ru:Команды консоли/tellraw zh:命令/tellraw