WhitelistToggleEvent

This class represents a Whitelist+ event triggered when the whitelist is toggled on or off. It is cancellable, allowing plugins to prevent the change in whitelist state.

Constructor

public WhitelistToggleEvent(boolean newState, Player triggeredBy, WhitelistSource source)
  • newState - The new state of the whitelist (true if enabled, false if disabled).

  • triggeredBy - The player who initiated the toggle (can be null).

  • source - The source of the toggle action (API, PLAYER, CONSOLE).

Methods

boolean getNewState()

Returns the new state of the whitelist.

boolean isEnabling()

Returns true if the whitelist is being enabled.

boolean isDisabling()

Returns true if the whitelist is being disabled.

Player getTriggeredBy()

Returns the player who triggered the toggle, or null if not applicable.

WhitelistSource getSource()

Returns the source of the toggle action.

boolean isCancelled()

Checks whether the event has been cancelled.

void setCancelled(boolean cancel)

Sets whether the event should be cancelled.

HandlerList getHandlers()

Standard Bukkit method to retrieve handlers for this event.

static HandlerList getHandlerList()

Returns the static handler list for this event class.

Last updated