Tellraw Command Guide: Colored Chat Messages with JSON

The /tellraw command lets you broadcast custom, formatted messages to players without displaying a sender name in the chat window. Whether you are building a single-player adventure map or running a multiplayer server, mastering JSON text components gives you full control over colors, styles, and interactive chat prompts.

Tellraw Generator

Basic Syntax and Target Selectors

Every tellraw command follows a straightforward structure consisting of the command name, a target, and your JSON message payload.

/tellraw <targets> <message>

Before writing your JSON message, you must choose who will see it using a player name or a target selector:

Important limitation: The standard Minecraft chat input box is strictly limited to 256 characters. While short test messages work fine in chat, complex JSON strings with multiple colors and actions will quickly exceed this limit. For long commands, always paste and trigger them inside a command block.

Creating Colored and Styled Text Components

In Java Edition, a tellraw message can be a simple quoted string, a single JSON object, or a list (array) of components enclosed in square brackets. An object lets you define the text alongside its formatting fields.

You can customize your message using the following text component fields:

To send a simple gold message to everyone, use a single object:

/tellraw @a {"text":"Hi","color":"gold"}

To combine multiple colors and styles in a single line, wrap multiple objects inside a JSON list:

/tellraw @a [{"text":"Warning: ","color":"red","bold":true},{"text":"The arena gates are opening!","color":"yellow","italic":true}]

Adding Click Actions and Hover Text

One of the strongest features of JSON chat in Java Edition is interactivity. You can attach a hover tooltip and an optional click action to any text component. The four available click actions are:

Syntax Changes in Java 1.21.5 vs. Older Versions

Pay close attention to your game version when adding interactive events. Java 1.21.5 renamed clickEvent to click_event and hoverEvent to hover_event. Furthermore, click actions in Java 1.21.5 use specific fields like url or command, whereas older versions use clickEvent and hoverEvent with a universal value field.

Here is how to run a command and show hover text in older Java versions:

/tellraw @a {"text":"[Click to Spawn]","color":"green","clickEvent":{"action":"run_command","value":"/trigger spawn"},"hoverEvent":{"action":"show_text","value":"Teleport to the hub"}}

Here is the updated syntax for Java 1.21.5 using the renamed fields and specific action keys:

/tellraw @a {"text":"[Visit Website]","color":"aqua","underlined":true,"click_event":{"action":"open_url","url":"https://text.9minecraft.net"}}
/tellraw @a {"text":"[Claim Kit]","color":"gold","click_event":{"action":"run_command","command":"/trigger starter_kit"}}

Dynamic Components: Selectors, Scores, Keybinds, and Translations

Beyond plain text, JSON messages support dynamic components that pull live information from the game world or the player's client settings:

You can mix these dynamic components into a component list alongside normal text. For example, to greet the closest player by their actual username and show their current control binding for jumping:

/tellraw @p [{"text":"Hello ","color":"yellow"},{"selector":"@p","color":"aqua"},{"text":"! Press ","color":"yellow"},{"keybind":"key.jump","color":"green","bold":true},{"text":" to start.","color":"yellow"}]

Using Tellraw in Minecraft Bedrock Edition

Minecraft Bedrock Edition also includes the /tellraw command, but its JSON structure is much simpler and does not use Java's color fields or click events. Instead, Bedrock wraps components inside a rawtext array and applies colors and styles directly inside the text string using section signs (§).

The basic Bedrock format looks like this:

/tellraw @a {"rawtext":[{"text":"§6Welcome to the server!"}]}

You can chain multiple formatting codes together inside the quotes to combine colors and styles:

/tellraw @p {"rawtext":[{"text":"§c§lAlert: §r§eYou entered a restricted zone."}]}

Step-by-Step: Generating Commands on text.9minecraft.net

Writing raw JSON by hand often leads to missing brackets or misplaced quotation marks. Using the generator tool on text.9minecraft.net speeds up the process and prevents syntax errors:

  1. Draft Your Message: Enter your desired message into the editor. If the tool supports shorthand formatting, you can write your message with & codes to quickly mark colors and styles.
  2. Choose Your Target: Select who should receive the message (@a, @p, @s, or @r).
  3. Add Interactivity: Configure an optional click action (open_url, run_command, suggest_command, or copy_to_clipboard) and enter your hover text if you are playing on Java Edition.
  4. Copy and Execute: Copy the generated /tellraw command. If it is under 256 characters, paste it directly into your chat bar. If it is longer, give yourself a command block (/give @s command_block), paste the command inside, and power it with a button or redstone block.

Questions

Why does my tellraw command get cut off when I paste it in chat?

Minecraft limits the chat input box to 256 characters. Because JSON formatting adds many brackets, quotes, and field names, you should paste long tellraw commands into a command block instead of the chat bar.

Why did my clickEvent and hoverEvent stop working in Java 1.21.5?

Java 1.21.5 renamed clickEvent to click_event and hoverEvent to hover_event. Additionally, click actions in 1.21.5 use specific fields like url or command instead of the generic value field used in older versions.

How do I add colors to a tellraw command in Bedrock Edition?

Bedrock Edition does not use the JSON color field. Instead, use the {"rawtext":[{"text":"..."}]} structure and place § formatting codes directly inside the text string.

Can I use & codes directly inside a vanilla /tellraw command?

Vanilla /tellraw does not parse & codes on its own. However, you can draft a message with & codes inside a generator tool to quickly convert them into valid JSON color and style fields for Java, or § codes for Bedrock.

Related guides

See all →