Discord

API Events

This page is dedicated to explain how LastLoginAPI events works.

You can handle a LastLoginAPI event like Bukkit ones:

@EventHandler
public void onPlayerChat(BukkitLastLoginPreUpdateLoginTimestampEvent event) {
    if (event.getPlayer().getName().equals("AlessioDP"))
        event.setCancelled(true);
}

@EventHandler
public void onPlayerChat(BukkitLastLoginPostUpdateLoginTimestampEvent event) {
    if (event.getPlayer().getName().equals("AlessioDP"))
        event.setCancelled(true);
}

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 BukkitLastLoginUpdateNameEvent or BungeeLastLoginUpdateNameEvent.

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
_LastLoginUpdateNameEvent✖ No✖ No✔ YesAll
_LastLoginPreUpdateLoginTimestampEvent✔ Yes✔ Yes✖ NoAll
_LastLoginPostUpdateLoginTimestampEvent✖ No✖ No✔ YesAll
_LastLoginPreUpdateLogoutTimestampEvent✔ Yes✔ Yes✖ NoAll
_LastLoginPostUpdateLogoutTimestampEvent✖ No✖ No✔ YesAll