PlayerNotWhitelistedEvent

This class represents a Whitelist+ event triggered when a player attempts to join the server but is not on the whitelist. Plugin developers can use this event to intercept or handle such cases (e.g., sending a custom kick message or allowing the join under certain conditions).

Constructor

public PlayerNotWhitelistedEvent(Player player)

Creates a new instance of the event.

  • player – The player who attempted to join without being whitelisted.

Methods

Player getPlayer()

Returns the player who attempted to join without being whitelisted.

boolean isCancelled()

Checks whether the event has been cancelled. If cancelled, the server may allow the player to join despite not being on the whitelist.

void setCancelled(boolean cancel)

Sets the cancelled status of the event.

  • true → The player will be allowed to join even if not whitelisted.

  • false → The player will be denied as usual.

HandlerList getHandlers()

Standard method required by Bukkit's event system.

static HandlerList getHandlerList()

Returns the handler list for this event class.

Last updated