Skip to main content

Notifications API

PetarLib for Minecraft servers provides a utility class for displaying in-game notifications to the player through the action bar (see image below) or through chat.

Action Bar Notification Example

Overview​

You can send 2 types of notifications through the API.

  • Action Bar Notifications:
NotificationManager.showActionBarNotif("§aThis is an action bar notification!", player);
  • Chat Notifications:
NotificationManager.sendChatNotif("§aThis is a chat notification!", player);

Color codes used by the methods​

The API uses Minecraft color codes (e.g., §a for green). To see the full list of Minecraft color codes, refer to the Minecraft Color Codes.