Events
Creating Events
/**
* Represents a simple ping event.
* This is used as an example.
*/
public class PingEvent extends Event {
private @NotNull String serverName;
/**
* Used to create a ping event.
*
* @param serverName The server that the ping was sent from.
*/
public PingEvent(@NotNull String serverName) {
this.serverName = serverName;
}
/**
* Used to get the name of the server
* the event was sent from.
*
* @return The name of the server.
*/
public @NotNull String getServerName() {
return this.serverName;
}
}Listening to Events
Calling Events
Last updated