Class NotificationManager

java.lang.Object
com.petarmc.lib.notification.NotificationManager

public class NotificationManager extends Object
Utility class for showing in-game notifications to the player. Only works on the client side. This class no longer relies on a global log prefix. Callers must supply a prefix when showing notifications (e.g. "[MyMod]").
  • Constructor Details

    • NotificationManager

      public NotificationManager()
  • Method Details

    • showChatMessage

      private static void showChatMessage(String msg)
    • showError

      public static void showError(String message, String prefix)
      Shows an error notification in chat.
      Parameters:
      prefix - the prefix to show (e.g. "[MyMod]") - may be empty
    • showInfo

      public static void showInfo(String message, String prefix)
      Shows an info notification in chat.
      Parameters:
      prefix - the prefix to show (e.g. "[MyMod]") - can be empty
    • showCustom

      public static void showCustom(String message, String colorCode, String prefix)
      Shows a custom notification in chat.
      Parameters:
      message - the message to show
      colorCode - the color code prefix like "§a"
      prefix - the prefix to show (e.g. "[MyMod]") - may be empty