Class TextIcons
Each icon is a private-use codepoint served by
IconGlyphProvider, which is installed at the
front of the minecraft:default font and rasterizes
textures/gui/icons/<name>.png at the current GUI scale. Because it lives in the
default font the codepoint just works anywhere text is drawn — no
Style.withFont, no resource-pack font json. The glyph is white with the shape
in alpha, so the surrounding &-colour tints it like a normal character.
These replace the old U+2139 / U+26A0 / U+2620 text symbols, which rendered
inconsistently (or not at all) depending on the active font.
Prefer the message helpers that wrap these — Module.info/warn/error,
Command.info/warn/error, or ChatUtils.info(java.lang.String) and friends — over
hand-assembling a prefix. Use of(Icon, ChatFormatting) when building a
Component by hand.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisIcon(char c) trueifcis one of the icon codepoints.static net.minecraft.network.chat.MutableComponentof(TextIcons.Icon icon) A single icon glyph, uncoloured.static net.minecraft.network.chat.MutableComponentof(TextIcons.Icon icon, net.minecraft.ChatFormatting color) A single icon glyph tinted withcolor.
-
Method Details
-
isIcon
public static boolean isIcon(char c) trueifcis one of the icon codepoints. -
of
A single icon glyph, uncoloured. -
of
public static net.minecraft.network.chat.MutableComponent of(TextIcons.Icon icon, net.minecraft.ChatFormatting color) A single icon glyph tinted withcolor.
-