Discord

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:

EventCancellableEditableAsyncServer
_PartiesPartyGetExperienceEvent✖ No✖ No✔ YesAll
_PartiesPartyLevelUpEvent✖ No✖ No✔ YesAll
_PartiesPartyPreBroadcastEvent✔ Yes✔ Yes✖ NoAll
_PartiesPartyPostBroadcastEvent✖ No✖ No✔ YesAll
_PartiesPartyPreCreateEvent✔ Yes✔ Yes✖ NoAll
_PartiesPartyPostCreateEvent✖ No✖ No✔ YesAll
_PartiesPartyPreDeleteEvent✔ Yes✔ Yes✖ NoAll
_PartiesPartyPostDeleteEvent✖ No✖ No✔ YesAll
_PartiesPartyPreExperienceDropEvent✔ Yes✔ Yes✖ NoAll
_PartiesPartyPreRenameEvent✔ Yes✔ Yes✖ NoAll
_PartiesPartyPostRenameEvent✖ No✖ No✔ YesAll
_PartiesPlayerPreChatEvent✔ Yes✔ Yes✖ NoAll
_PartiesPlayerPostChatEvent✖ No✖ No✔ YesAll
_PartiesPlayerPreInviteEvent✔ Yes✔ Yes✖ NoAll
_PartiesPlayerPostInviteEvent✖ No✖ No✔ YesAll
_PartiesPlayerPreJoinEvent✔ Yes✔ Yes✖ NoAll
_PartiesPlayerPostJoinEvent✖ No✖ No✔ YesAll
_PartiesPlayerPreLeaveEvent✔ Yes✔ Yes✖ NoAll
_PartiesPlayerPostLeaveEvent✖ No✖ No✔ YesAll
BungeePartiesPartyFollowEvent✔ Yes✔ Yes✖ NoBungeeCord
VelocityPartiesPartyFollowEvent✔ Yes✔ Yes✖ NoVelocity
BukkitPartiesCombustFriendlyFireBlockedEvent✔ Yes✖ No✖ NoBukkit
BukkitPartiesFishHookFriendlyFireBlockedEvent✔ Yes✖ No✖ NoBukkit
BukkitPartiesFriendlyFireBlockedEvent✔ Yes✖ No✖ NoBukkit
BukkitPartiesPotionsFriendlyFireBlockedEvent✔ Yes✖ No✖ NoBukkit