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:
Event | Cancellable | Editable | Async | Server |
---|---|---|---|---|
_LastLoginUpdateNameEvent | ✖ No | ✖ No | ✔ Yes | All |
_LastLoginPreUpdateLoginTimestampEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_LastLoginPostUpdateLoginTimestampEvent | ✖ No | ✖ No | ✔ Yes | All |
_LastLoginPreUpdateLogoutTimestampEvent | ✔ Yes | ✔ Yes | ✖ No | All |
_LastLoginPostUpdateLogoutTimestampEvent | ✖ No | ✖ No | ✔ Yes | All |