v1.33.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2023 License: MIT Imports: 4 Imported by: 56



Package text has utility methods used for formatting text to display in Minecraft, and to convert these colour codes into codes suitable for the command line.



This section is empty.


This section is empty.


func ANSI

func ANSI(a ...any) string

ANSI converts all Minecraft text formatting codes in the values passed to ANSI formatting codes, so that it may be displayed properly in the terminal.

func Clean added in v1.25.1

func Clean(s string) string

Clean removes all Minecraft formatting codes from the string passed.

func Colourf

func Colourf(format string, a ...any) string

Colourf colours the format string using HTML tags after first escaping all parameters passed and substituting them in the format string. The following colours and formatting may be used:

black, dark-blue, dark-green, dark-aqua, dark-red, dark-purple, gold, grey, dark-grey, blue, green, aqua,
red, purple, yellow, white, dark-yellow, quartz, iron, netherite, redstone, copper, gold, emerald, diamond,
lapis, amethyst, obfuscated, bold (b), and italic (i).

These HTML tags may also be nested, like so: `<red>Hello <bold>World</bold>!</red>`


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL