Text Component

Data Type

A String or Object used for displaying text with fancy formatting.

Note

You can refer to Minecraft Wiki: Raw JSON text format for JSON text components you can use.

Examples

"text": "This is an example text string!"

This example will display a text that says "This is an example text string!".

"text": {
    "text": "This is an example text string with a fancy color!",
    "color": "yellow"
}

This example will display a yellow-colored text that says "This is an example text string with a fancy color!"

"text": [
    "This is an example text string with a translated keybind (",
    {
        "keybind": "key.attack"
    },
    ") using the 'keybind' JSON text component!"
]

This example will display a text that'd say "This is an example text string with a translated keybind (<keybind>) using the 'keybind' JSON text component", with <keybind> being the translated name of the key.attack keybind.