FancyCoreApi
Events
Events API for FancyCore
FancyCore has its own event system that allows you to listen to various events that happen in the FancyCore system.
Registering an event listener
Example for registering a listener for the PlayerReportedEvent:
EventService eventService = FancyCore.get().getEventService();
eventService.registerListener(PlayerReportedEvent.class, (event) -> {
System.out.println("PlayerReportedEvent fired with report id: " + event.getReport().id());
});Available events
Abstract events
| Event | Description |
|---|---|
FancyEvent | Base event class for all events in the FancyCore plugin. |
PlayerEvent | Base event class for all player-related events |
Player events
| Event | Description |
|---|---|
PlayerModifiedEvent | Fired when a player's data is modified (through FancyPlayer's setters). |
PlayerReportedEvent | Fired when a player is reported. |
PlayerPunishedEvent | Fired when a player receives a punishment (warning, kick, mute or ban). |
Chat events
| Event | Description |
|---|---|
PlayerSentMessageEvent | Fired when a player sends a chat message in a chat room. |
PlayerSwitchedChatRoomEvent | Fired when a player switches chat rooms. |
PlayerWatchedChatRoomEvent | Fired when a player starts watching a chat room. |
PlayerUnwatchedChatRoomEvent | Fired when a player stops watching a chat room. |
ChatClearedEvent | Fired when a chat room is cleared. |
BroadcastMessageSentEvent | Fired when a broadcast message is sent to a chat room. |