Class MessageParser

java.lang.Object
dev.ua.theroer.magicutils.logger.MessageParser

public final class MessageParser extends Object
Shared helpers for parsing MiniMessage/legacy hybrid strings.
  • Method Details

    • parseSmart

      public static net.kyori.adventure.text.Component parseSmart(String input)
      Parse a string that may contain legacy colors and/or MiniMessage tags.
      Parameters:
      input - source string
      Returns:
      parsed component (never null)
    • escapeAttribute

      public static String escapeAttribute(String value)
      Escapes a value for use inside a MiniMessage tag attribute (e.g. the target of <click:run_command:"..."> or <hover:show_text:"...">), so quotes and tag brackets in the value don't break the surrounding tag.
      Parameters:
      value - raw attribute value (null yields empty string)
      Returns:
      escaped value safe to embed in a quoted MiniMessage attribute