Class TextIcons

java.lang.Object
me.hackware.api.util.TextIcons

public final class TextIcons extends Object
Icon glyphs usable inline in chat / HUD text.

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
    Modifier and Type
    Class
    Description
    static enum 
    The available icon glyphs.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isIcon(char c)
    true if c is one of the icon codepoints.
    static net.minecraft.network.chat.MutableComponent
    A single icon glyph, uncoloured.
    static net.minecraft.network.chat.MutableComponent
    of(TextIcons.Icon icon, net.minecraft.ChatFormatting color)
    A single icon glyph tinted with color.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isIcon

      public static boolean isIcon(char c)
      true if c is one of the icon codepoints.
    • of

      public static net.minecraft.network.chat.MutableComponent of(TextIcons.Icon icon)
      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 with color.