Text
Skript allows you to write pieces of text (aka strings).
This is done by putting the text inside double quotes, for example: "this is text".
If an effect, expression, condition, trigger or function accepts something of type text or string, you can use this format to create a new string.
Colors and Formatting
Section titled “Colors and Formatting”Skript uses Adventure and MiniMessage for text formatting. MiniMessage is a tag-based system that uses angle brackets, and it is the recommended way to format text in Skript:
send "<red>Hello there <bold>%player%!" to playerTags generally come in opening and closing pairs, though closing tags are usually optional for color and decoration tags:
send "<red>This is red <bold>and bold</bold> but this is just red again" to playerColor Tags
Section titled “Color Tags”Minecraft has 16 legacy colors that can have named tag equivalents:
| Tag | Legacy Code | Alternative Names |
|---|---|---|
<black> | §0 | |
<dark_blue> | §1 | |
<dark_green> | §2 | |
<cyan> | §3 | <dark_aqua>, <dark_cyan>, <dark_turquoise> |
<dark_red> | §4 | |
<purple> | §5 | <dark_purple> |
<gold> | §6 | <orange>, <dark_yellow> |
<gray> | §7 | <grey>, <light_gray>, <silver> |
<dark_gray> | §8 | <dark_grey> |
<blue> | §9 | <light_blue>, <indigo> |
<green> | §a | <light_green>, <lime> |
<aqua> | §b | <light_aqua>, <turquoise> |
<red> | §c | <light_red> |
<magenta> | §d | <light_purple>, <pink> |
<yellow> | §e | <light_yellow> |
<white> | §f |
Each colour can also be written with spaces instead of _: <dark blue>, though this is not recommended and may be deprecated in the future.
For a full spectrum of colors, you can use 6-digit hexadecimal color tags:
send "<#ABCDEF>Hey %player%!" to playersend "<#ff6b6b>Warning!" to playerYou can also format colours in the verbose MiniMessage format: <color:yellow>, but using _ instead of spaces is mandatory.
Decoration Tags
Section titled “Decoration Tags”Text decorations work the same way as color tags:
| Tag | Legacy Code | Description |
|---|---|---|
<bold> | §l | Makes the provided text bold. |
<italic> | §o | Makes the provided text italic. |
<underlined> | §n | Makes the provided text underlined. |
<strikethrough> | §m | Makes the provided text appear with a line through the middle. |
<obfuscated> | §k | Makes the provided text unreadable (rapidly cycling characters). |
<reset> | §r | Resets all active formatting. |
Using <!tag> can be used to prevent that formatting instead:
# Item names are naturally italicized by Minecraft:set name of player's tool to "<!i>Not Italicized!"Advanced Formatting Tags
Section titled “Advanced Formatting Tags”MiniMessage supports more advanced formatting options that have no legacy equivalents.
# Gradient between two or more colorssend "<gradient:#ff0000:#0000ff>Red to blue!</gradient>" to player
# Rainbow cycling colorssend "<rainbow>Wow this text is super colorful!</rainbow>" to player
# Color transitionssend "<transition:#ff0000:#ffffff:#0000ff:0.5>Transition!</transition>" to playerYou can read more about all available MiniMessage tags on Paper’s documentation.
Safe Tags
Section titled “Safe Tags”Not all MiniMessage tags are processed automatically.
To prevent unintended formatting (for example, from player input being included in a message), Skript only parses a set of safe tags by default.
Tags outside this list are left as plain text unless you use the formatted expression (see below).
The default safe tags are:
| Tag(s) | Description |
|---|---|
color | Named colors and hex colors (<red>, <#AABBCC>, etc.) |
decorations | Text styling (<bold>, <italic>, <underlined>, <strikethrough>, <obfuscated>) |
gradient | A gradient between multiple colours |
rainbow | A rainbow gradient |
reset | Resets all active formatting |
transition | A selected colour on a gradient scale |
pride | Pride-themed rainbow colors |
shadowColor | Sets the drop shadow color of text |
The formatted Expression
Section titled “The formatted Expression”When you need to process tags that are outside the safe tags list, use the formatted expression.
This processes the full MiniMessage tag set on the given string:
# sprite tags are not safe by default, so we use formatted to process themsend formatted "Look at my <sprite:blocks:block/stone>!" to playerConfiguring Safe Tags
Section titled “Configuring Safe Tags”You can control which tags are parsed automatically by editing the safe tags option in config.sk:
safe tags: color, decorations, gradient, rainbow, reset, transition, pride, shadowColorTo allow additional tags to be parsed automatically, add them to the list.
For example, to also allow sprite tags:
safe tags: color, decorations, gradient, rainbow, reset, transition, pride, shadowColor, spriteTo restrict automatic parsing to only colors and decorations, simply remove unwanted entries:
safe tags: color, decorationsChat-only Formatting
Section titled “Chat-only Formatting”Skript also supports some custom names for certain features that are only available in chat messages. These use the same tag format:
<name:parameter>| Tag | Alternative Names | MiniMessage Equivalent | Description |
|---|---|---|---|
<link:url> | <open_url:url>, <url:url> | <click:open_url:url> | Opens a URL when the player clicks on the text. Must be an http or https URL. |
<run_command:cmd> | <command:cmd>, <cmd:cmd> | <click:run_command:cmd> | Makes the player execute a command when they click on the text. |
<suggest_command:cmd> | <sgt:cmd> | <click:suggest_command:cmd> | Adds a command to the player’s chat input when clicked. |
<tooltip:text> | <show_text:text>, <ttp:text> | <hover:show_text:'text'> | Shows a tooltip when the player hovers over the text. |
<insertion:text> | <insert:text>, <ins:text> | <insert:text> | Appends text to the player’s chat input when SHIFT-clicked. |
These tags are not in the safe tags list, so they must be used with the formatted expression:
send formatted "<click:run_command:/gamemode creative><green>Click to enter creative mode!</click>" to playersend formatted "<tooltip:'<yellow>This is a tooltip'>Hover over me!</hover>" to playersend formatted "<link:https://skriptlang.org>Visit the Skript website</click>" to playerMinimessage also supports more click and hover events, like opening dialogs, showing item tooltips, and more. These can all be viewed at MiniMessage’s docs.
Unicode
Section titled “Unicode”Skript supports Unicode characters in any text. To add them to your scripts, paste the character inside the text, or use the provided Unicode tag.
The unicode tag is not safe by default, so you will need to use formatted. Pasted characters do not need formatted.
The tag uses the character’s codepoint to replace it with the actual character when the text is loaded.
"🐛 hello <u:1F41B>" # 🐛 hello 🐛"<unicode:03B5> <unicode:2245> <unicode:0194>, right?" # ε ≅ Ɣ, right?