Class NotificationManager

java.lang.Object
com.petarmc.petarlib.notifications.NotificationManager

public class NotificationManager extends Object
  • Constructor Details

    • NotificationManager

      public NotificationManager()
  • Method Details

    • sendActionBarNotification

      public void sendActionBarNotification(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component)
      Shows an action bar notification to the player. This will appear above the player's hotbar and disappear after a few seconds. Supports Adventure API Components ONLY!
      Parameters:
      player - The player to whom the action bar notification will be shown.
      component - The component to show as an action bar notification.
    • sendChatNotification

      public void sendChatNotification(org.bukkit.entity.Player player, net.kyori.adventure.text.Component component)
      Shows a chat message to the player. Supports Adventure API Components ONLY!
      Parameters:
      player - The player to whom the chat message will be sent.
      component - The component to send as a chat message.
    • sendTitleNotification

      public void sendTitleNotification(org.bukkit.entity.Player player, net.kyori.adventure.title.Title title)
      Shows a title notification to the player. This will appear in the center of the player's screen and can include a title, subtitle, and fade in/out times. Supports Adventure API Title objects ONLY!
      Parameters:
      player - The player to whom the title notification will be shown.
      title - The Title object to show as a title notification, can include title text, subtitle text, and timing information.
    • sendActionBarNotificationLegacy

      public void sendActionBarNotificationLegacy(org.bukkit.entity.Player player, String message)
      Shows an action bar notification to the player. This will appear above the player's hotbar and disappear after a few seconds. Supports legacy color codes (e.g. &c for red) and formatting codes.
      Parameters:
      player - The player to whom the action bar notification will be shown.
      message - The message to show as an action bar notification, can use legacy color.
    • sendChatNotificationLegacy

      public void sendChatNotificationLegacy(org.bukkit.entity.Player player, String message)
      Shows a chat message to the player. Supports legacy color codes (e.g. &c for red) and formatting codes.
      Parameters:
      player - The player to whom the chat message will be sent.
      message - The message to send as a chat message, can use legacy color.
    • sendTitleNotificationLegacy

      public void sendTitleNotificationLegacy(org.bukkit.entity.Player player, String title, String subtitle)
      Shows a title notification to the player. This will appear in the center of the player's screen. Supports legacy color codes (e.g. &c for red) and formatting codes.
      Parameters:
      player - The player to whom the title notification will be shown.
      title - The title text to show, can use legacy color.
      subtitle - The subtitle text to show, can use legacy color.