API Events
Parties offers a lot of events that you can listen to. These events can be handled by importing the API into your project.
You can handle a Parties event like Bukkit ones:
@EventHandler
public void onPlayerChat(BukkitPartiesPartyPreChatEvent event) {
if (event.getMessage().equals("nope!"))
event.setCancelled(true);
}
Usually events are differentiate by a PRE and POST event. Usually Pre events are executed before the actual event and can be cancelled, posts are not cancellable and are executed right after the occurrence of the event.
Both Bukkit and Bungee/Velocity events are supported
Due to different event interface between Bungeecord and Bukkit, we must choose which event to handle.
To do that you just need to append Bukkit or Bungee before the event class name, like "BukkitPartiesPlayerPreChatEvent" or "BungeePartiesPlayerPreChatEvent".
List of events
Some events are cancellable or editable (editable means that you can edit the values of the event).
This is a list of the supported events:
Event | Cancellable | Editable | Async | Server |
---|---|---|---|---|
_PartiesPartyGetExperienceEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPartyLevelUpEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPartyPreBroadcastEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPartyPostBroadcastEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPartyPreCreateEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPartyPostCreateEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPartyPreDeleteEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPartyPostDeleteEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPartyPreExperienceDropEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPartyPreRenameEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPartyPostRenameEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPlayerPreChatEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPlayerPostChatEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPlayerPreInviteEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPlayerPostInviteEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPlayerPreJoinEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPlayerPostJoinEvent | ✖ No | ✖ No | ✔ Yes | All |
_PartiesPlayerPreLeaveEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_PartiesPlayerPostLeaveEvent | ✖ No | ✖ No | ✔ Yes | All |
BungeePartiesPartyFollowEvent | ✔ Yes | ✔ Yes | ✖ No | BungeeCord |
VelocityPartiesPartyFollowEvent | ✔ Yes | ✔ Yes | ✖ No | Velocity |
BukkitPartiesCombustFriendlyFireBlockedEvent | ✔ Yes | ✖ No | ✖ No | Bukkit |
BukkitPartiesFishHookFriendlyFireBlockedEvent | ✔ Yes | ✖ No | ✖ No | Bukkit |
BukkitPartiesFriendlyFireBlockedEvent | ✔ Yes | ✖ No | ✖ No | Bukkit |
BukkitPartiesPotionsFriendlyFireBlockedEvent | ✔ Yes | ✖ No | ✖ No | Bukkit |