-
Notifications
You must be signed in to change notification settings - Fork 0
API
Nyxon edited this page Mar 24, 2026
·
1 revision
PotatoEssentials provides several custom events for developers to extend functionality.
Triggered when a player sends a private message using /msg or /reply.
-
Methods:
-
getSender(): Returns the Player sending the message. -
getReceiver(): Returns the Player receiving the message. -
getMessageContent(): Returns the raw string message. -
getSenderMessage(): Returns the formatted Component seen by the sender. -
isReply(): Boolean indicating if/rwas used.
-
Triggered when a player's vanish state changes.
-
Methods:
-
isVanished(): Returns true if the player is now hidden.
-
Triggered when a player is blocked from chatting by the cooldown system.
-
Methods:
-
getRemainingSeconds(): Double value of the remaining wait time. -
getChannel(): The string key of the chat channel (e.g., "global").
-
@EventHandler
public void onPrivateMessage(PlayerMessagePlayerEvent event) {
if (event.getMessageContent().contains("badword")) {
event.setCancelled(true);
}
}