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 through the action bar. 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

    • showNotification

      private static void showNotification(String msg)
    • showError

      public static void showError(String message, String prefix)
      Shows an error notification in chat.
      Parameters:
      message - the error message to show
      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:
      message - the message to show
      prefix - the prefix to show (e.g. "[MyMod]") - can be empty
    • showCustomNotification

      public static void showCustomNotification(String message)
      Shows a custom notification in chat.
      Parameters:
      message - the message to show (supports color codes like "§a")