Formatting TextBut isn't just text a bit boring? Worry not, as Minecraft has support for colors, styles and other formatting options in chat. Most of the options also work with item and entity names.
ColorsMinecraft has 16 pre-set color codes to be used in text. Skript supports them in two different ways:
- Color name tags, for example <red>
- (Old) Minecraft color codes, like §c; using & works, too
Here's a table of all colors, including both Skript names and color codes:
|§3||cyan||aqua, dark cyan, dark aqua, dark turquoise, dark turquois|
|§6||orange||orange, gold, dark yellow|
|§7||grey||light grey, gray, light gray, silver|
|§8||grey||light grey, gray, light gray, silver|
|§9||light blue||light blue, indigo|
|§a||light green||lime, lime green|
|§b||light cyan||light aqua, turquoise, turquois, light blue|
In Minecraft 1.16, support was added for 6-digit hexadecimal colors to specify custom colors other than the 16 default color codes. A new tag can be used to format with these colors. The tag looks like this:
Here's what the tag would look like when used in a script:
send "<#123456>Hey %player%!" to player
For information not related to Skript, see Minecraft Wiki page concerning colors. Note that depending on Skript configuration, color codes may do more than just change color of text after them. By default, for backwards compatibility, they clear following styles: magic, bold, strikethrough, underlined, italic. Other styles are not affected, and this feature can be toggled of in config.sk.
Other StylesMinecraft also has various other styles available. The following are available everywhere, including item and entity names:
Skript also supports certain newer features, which are only available in chat. Those do not have formatting codes, so you must use tags for them.
|link||open url, url||Opens a link when player clicks on text|
|run command||command, cmd||Makes player execute a chat command when they click on text|
|suggest command||Adds a command to chat prompt of player when clicked|
|tooltip||show text||Shows a tooltip when player hovers over text with their mouse|
Text and VariablesVariable names are text, but obviously formatting that text does no good. However, everything else you can do for text, you can do for variable names. A guide about this is coming... some day.
Guide written by bensku.