MC Toolkit

Guides / Commands & Data

/tellraw text components: click_event, hover_event and why your message shows nothing

A single wrong bracket means tellraw sends nothing to its targets. Here is the component shape, the click and hover actions that actually work in chat, and the escaping rule people miss.

/tellraw takes a text component, and the failure mode is unhelpful: a malformed component produces no message for anyone it targets — the only error goes to whoever ran the command, or into a command block's output, where nobody is looking. Everything below is about getting the shape right the first time.

The three valid shapes

"plain string"
{"text":"one component"}
["joined ",{"text":"list","color":"gold"}]

The list form is the one to use for anything interesting, because each element can carry its own formatting. The first element's formatting is inherited by the rest unless they override it — which is why people get a whole message unexpectedly gold. Start a list with an empty string to avoid that:

/tellraw @a ["",{"text":"Warning: ","color":"red"},{"text":"low health"}]

Click actions

click_event takes an action plus that action's own field — there is no shared value:

ActionFieldNote
run_commandcommand: "/spawn"Runs as the player, at their permission level
suggest_commandcommand: "/msg Steve "Fills the chat box, does not send
open_urlurl: "https://…"Prompts before opening
copy_to_clipboardvalue: "any text"The friendliest one for sharing coordinates
change_pagepage: 2Books only

run_command is the one with a trap: it executes with the clicking player's permissions, not the command block's. A menu that calls /gamemode creative does nothing for a normal player.

Hover actions

"hover_event":{"action":"show_text","value":["Click to teleport"]}

show_text, show_item and show_entity. Note the names — older guides use hoverEvent, clickEvent and contents, which 1.21.5 replaced with hover_event, click_event and, for show_text, value. That rename accounts for a lot of dead hover tooltips copied from tutorials.

Escaping is where it breaks

The whole component is one command argument, so quotes inside must survive the command parser. In a command block, type it directly. In a function file, backslash-escaping is not needed. In a /give written book, pages are text components too, written as SNBT — no string-inside-a-string escaping since 1.21.5, and a page still written as an escaped JSON string now shows up as literal text with its quotes.

Rule of thumb: if you are nesting text components inside an item component, build it with a tool rather than by hand.

Selectors inside text

{"selector":"@p","separator":{"text":", "}}

resolves to player names at send time. {"score":{"name":"@s","objective":"Kills"}} pulls a scoreboard value. Both beat trying to concatenate values yourself.

Translate keys travel across languages

{"translate":"block.minecraft.crafting_table"}

renders in each player's own language — 제작대 for a Korean client, 作業台 for a Japanese one. For a multilingual server this is strictly better than hardcoding English.

Build and preview text and display commands in the Text & Display Command Builder.

Text & Display Command Builder →

More guides

Browse all →