
Command reference
Text Components
Text components are the formatted text used by /tellraw, /title, signs, item names and entity names. A component is a quoted string, an object in braces with content and styling fields, or a list of components.
| Plain text | A quoted string: "Hello" or 'Hello'. |
| Object | {text:"Hello",color:"red"}. Field names may be written with or without quotes. |
| List | ["A",{text:"B"}]. The first entry is the parent; the others follow it and take over its styling. |
| Content types | text, translatable, score, selector, keybind, nbt, object. The type is recognized from the fields; a type field is optional. |
| Color names | black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow, white. |
| Hex colors | # followed by six hex digits, such as #FF8800. |
| Inherited styling | Parts in extra use the styling of their parent unless they set their own. |
| Click actions | open_url, run_command, suggest_command, show_dialog, change_page, copy_to_clipboard, custom. open_file is refused in commands. |
| Hover actions | show_text, show_item, show_entity. |
| Line break | \n inside quoted text. |
| text | Shows the given text | /tellraw @a {text:"Hello",color:"red"} |
| translate | Shows a translated text by its key | /tellraw @a {translate:"block.minecraft.stone"} |
| with | Values put into the placeholders of a translated text | /tellraw @a {translate:"chat.type.announcement",with:["Server","Hello"]} |
| fallback | Text used when the translation key is unknown | /tellraw @a {translate:"my.custom.key",fallback:"Hi %s",with:[{selector:"@s"}]} |
| score | Shows a score. Needs name (a name or selector) and objective | /tellraw @a ["Score: ",{score:{name:"@s",objective:"kills"},color:"gold"}] |
| selector | Shows the names of the selected entities | /tellraw @a {selector:"@a",separator:" and "} |
| separator | Text put between several names or values | /tellraw @a {selector:"@a",separator:{text:" | ",color:"gray"}} |
| keybind | Shows the key the reader has set for a control | /tellraw @a {keybind:"key.jump"} |
| nbt | Shows a value read from data by a data path | /tellraw @a {nbt:"Health",entity:"@s"} |
| entity | Reads the nbt value from the selected entities | /tellraw @a {nbt:"Pos",entity:"@s",plain:true,separator:", "} |
| block | Reads the nbt value from the block at a position | /tellraw @a {nbt:"Items[0].id",block:"~ ~-1 ~"} |
| storage | Reads the nbt value from command storage | /tellraw @a {nbt:"message",storage:"my_pack:data",interpret:true} |
| interpret | Treats the nbt value as a text component. Cannot be combined with plain | /tellraw @a {nbt:"message",storage:"my_pack:data",interpret:true} |
| plain | Shows the nbt value without coloring. Cannot be combined with interpret | /tellraw @a {nbt:"Pos",entity:"@s",plain:true,separator:", "} |
| sprite | Shows a picture from a texture atlas | /tellraw @a {sprite:"minecraft:block/diamond_block"} |
| atlas | Atlas the sprite comes from. Default is minecraft:blocks | /tellraw @a {atlas:"minecraft:items",sprite:"minecraft:item/diamond"} |
| player | Shows the head of a player skin | /tellraw @a {player:{name:"Notch"},hat:false} |
| hat | Whether the hat layer of the head is drawn. Default is true | /tellraw @a {player:{name:"Notch"},hat:false} |
| type | Names the content type outright: text, translatable, score, selector, keybind, nbt or object | /tellraw @a {type:"text",text:"Typed"} |
| extra | More components shown right after this one | /tellraw @a {text:"A",color:"red",extra:[{text:"B",bold:true},"C"]} |
| color | Text color, a color name or #RRGGBB | /tellraw @a {text:"Hello",color:"#FF8800"} |
| shadow_color | Color of the text shadow, one number or [red,green,blue,alpha] from 0 to 1 | /tellraw @a {text:"Hello",shadow_color:[1.0f,0.0f,0.0f,1.0f]} |
| bold | Bold text, true or false | /tellraw @a {text:"A",color:"red",extra:[{text:"B",bold:true},"C"]} |
| italic | Slanted text, true or false | /title @a subtitle {text:"Good luck",italic:true} |
| underlined | Line under the text, true or false | /tellraw @a {text:"Hello",color:"#FF8800",bold:true,italic:true,underlined:true,strikethrough:true,obfuscated:false} |
| strikethrough | Line through the text, true or false | /tellraw @a {text:"Hello",color:"#FF8800",bold:true,italic:true,underlined:true,strikethrough:true,obfuscated:false} |
| obfuscated | Scrambled, constantly changing letters, true or false | /tellraw @a {text:"Hello",color:"#FF8800",bold:true,italic:true,underlined:true,strikethrough:true,obfuscated:false} |
| font | Id of the font to draw with | /tellraw @a {text:"Hello",font:"minecraft:alt"} |
| insertion | Text put into the chat box when the text is shift-clicked | /tellraw @a {text:"Shift-click me",insertion:"inserted text"} |
| click_event | What happens when the text is clicked | /tellraw @a {text:"Click",click_event:{action:"run_command",command:"/say hi"}} |
| hover_event | What is shown when the pointer rests on the text | /tellraw @a {text:"Hover",hover_event:{action:"show_text",value:"Tooltip"}} |
| run_command | command | Runs the command as the player who clicks | /tellraw @a {text:"Click",click_event:{action:"run_command",command:"/say hi"}} |
| suggest_command | command | Puts the text into the chat box | /tellraw @a {text:"Click",click_event:{action:"suggest_command",command:"/tp @s 0 64 0"}} |
| open_url | url | Opens a web address | /tellraw @a {text:"Click",click_event:{action:"open_url",url:"https://www.minecraft.net"}} |
| copy_to_clipboard | value | Copies the text to the clipboard | /tellraw @a {text:"Click",click_event:{action:"copy_to_clipboard",value:"copied text"}} |
| change_page | page | Turns to a page in a book, 1 or higher | /tellraw @a {text:"Click",click_event:{action:"change_page",page:2}} |
| show_dialog | dialog | Opens a dialog, by id or written out | /tellraw @a {text:"Click",click_event:{action:"show_dialog",dialog:"minecraft:server_links"}} |
| custom | id, payload (optional) | Sends a custom event to the server | /tellraw @a {text:"Click",click_event:{action:"custom",id:"my_pack:event",payload:{a:1}}} |
| show_text | value | A text component as tooltip | /tellraw @a {text:"Hover",hover_event:{action:"show_text",value:{text:"Tooltip",color:"yellow"}}} |
| show_item | id, count (optional), components (optional) | The tooltip of an item | /tellraw @a {text:"Hover",hover_event:{action:"show_item",id:"minecraft:diamond_sword",count:1,components:{"minecraft:damage":5}}} |
| show_entity | id, uuid, name (optional) | Type, name and UUID of an entity | /tellraw @a {text:"Hover",hover_event:{action:"show_entity",id:"minecraft:pig",uuid:"dd12be42-52a9-4a91-a8a1-11c01849e498",name:"Porky"}} |
| Chat message | /tellraw @a "Hello" |
| Title | /title @a title {text:"Welcome",color:"gold",bold:true} |
| Action bar | /title @a actionbar {text:"Low health",color:"red"} |
| Sign text | /setblock ~ ~ ~ minecraft:oak_sign{front_text:{messages:["Line 1",{text:"Line 2",color:"red"},"",""]}} |
| Entity name | /summon minecraft:zombie ~ ~ ~ {CustomName:{text:"Boss",color:"dark_red"},CustomNameVisible:1b} |
| Item name | /give @s minecraft:stick[custom_name={text:"Magic Wand",color:"gold",italic:false}] |
| Boss bar name | /bossbar add my_pack:boss {text:"Boss",color:"red"} |
| Objective name | /scoreboard objectives add kills minecraft.killed:minecraft.zombie {text:"Zombie Kills",color:"green"} |
/tellraw @a {text:"Hello",color:"red"}Sends a red Hello to every player.
/tellraw @a ["",{text:"A",color:"red"},{text:"B",color:"blue"}]Sends a red A followed by a blue B. The empty first entry keeps the colors apart.
/tellraw @a {text:"Click",click_event:{action:"suggest_command",command:"/tp @s 0 64 0"}}Sends text that fills the chat box with a teleport command when clicked.
/tellraw @a ["Score: ",{score:{name:"@s",objective:"kills"},color:"gold"}]Shows the kills score of whoever runs the command.
/tellraw @a {text:"Hover",hover_event:{action:"show_item",id:"minecraft:diamond_sword",count:1,components:{"minecraft:damage":5}}}Sends text that shows a diamond sword tooltip when the pointer rests on it.
/title @a title {text:"Welcome",color:"gold",bold:true}Shows a bold gold title to every player.
/title @a subtitle {text:"Good luck",italic:true}Sets the subtitle shown under the next title.
/title @a actionbar {text:"Low health",color:"red"}Shows red text above the hotbar.
/title @a times 0.5s 3s 1sSets titles to fade in for half a second, stay 3 seconds and fade out for 1 second.

