Class DatMessageFormatter

java.lang.Object
com.datdeveloper.datmoddingapi.util.DatMessageFormatter

public class DatMessageFormatter extends Object
A class for formatting
  • Constructor Details

    • DatMessageFormatter

      public DatMessageFormatter(String formatString, Object... args)
  • Method Details

    • formatChatString

      public static net.minecraft.network.chat.Component formatChatString(String formatString, Object... args)
      Format the given chat string into a chat component using objects passed as arguments
      A shortcut function for DatMessageFormatter
      When an error is encountered in the DatMessageFormatter Then it is caught and dumped in the chat message. DatMessageFormatter should be used directly if you desire handling the error yourself.
      Parameters:
      formatString - The string that is processed
      args - The arguments to use to format the string
      Returns:
      A chat component containing the formatted text
      See Also:
    • parse

      public net.minecraft.network.chat.Component parse() throws ChatParseException
      Parse the given formatString using the arguments
      Returns:
      The processed message
      Throws:
      ChatParseException - Thrown when an exception is encountered whilst parsing the string