Skip to content

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.

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 player

Tags 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 player

Minecraft has 16 legacy colors that can have named tag equivalents:

TagLegacy CodeAlternative 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 player
send "<#ff6b6b>Warning!" to player

You can also format colours in the verbose MiniMessage format: <color:yellow>, but using _ instead of spaces is mandatory.

Text decorations work the same way as color tags:

TagLegacy CodeDescription
<bold>§lMakes the provided text bold.
<italic>§oMakes the provided text italic.
<underlined>§nMakes the provided text underlined.
<strikethrough>§mMakes the provided text appear with a line through the middle.
<obfuscated>§kMakes the provided text unreadable (rapidly cycling characters).
<reset>§rResets 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!"

MiniMessage supports more advanced formatting options that have no legacy equivalents.

# Gradient between two or more colors
send "<gradient:#ff0000:#0000ff>Red to blue!</gradient>" to player
# Rainbow cycling colors
send "<rainbow>Wow this text is super colorful!</rainbow>" to player
# Color transitions
send "<transition:#ff0000:#ffffff:#0000ff:0.5>Transition!</transition>" to player

You can read more about all available MiniMessage tags on Paper’s documentation.

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
colorNamed colors and hex colors (<red>, <#AABBCC>, etc.)
decorationsText styling (<bold>, <italic>, <underlined>, <strikethrough>, <obfuscated>)
gradientA gradient between multiple colours
rainbowA rainbow gradient
resetResets all active formatting
transitionA selected colour on a gradient scale
pridePride-themed rainbow colors
shadowColorSets the drop shadow color of text

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 them
send formatted "Look at my <sprite:blocks:block/stone>!" to player

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, shadowColor

To 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, sprite

To restrict automatic parsing to only colors and decorations, simply remove unwanted entries:

safe tags: color, decorations

Skript also supports some custom names for certain features that are only available in chat messages. These use the same tag format:

<name:parameter>
TagAlternative NamesMiniMessage EquivalentDescription
<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 player
send formatted "<tooltip:'<yellow>This is a tooltip'>Hover over me!</hover>" to player
send formatted "<link:https://skriptlang.org>Visit the Skript website</click>" to player

Minimessage also supports more click and hover events, like opening dialogs, showing item tooltips, and more. These can all be viewed at MiniMessage’s docs.

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?