Skip to content

PlayerJoinAttemptEvent

PlayerJoinAttemptEvent is the supported extension point for custom access rules, maintenance, network queues, or external cooldowns.


Whack Me fires it only after checking that:

  • The player is not already in an arena.
  • The target arena is ready and has a game runtime.
  • The arena is unoccupied.
  • The built-in replay cooldown allows the player.

Cancellation prevents the join and does not modify the game. No denial message is sent automatically.


MethodReturn typeDescription
getGame()GameTarget game.
getPlayer()PlayerJoining player.
getUser()UserWhack Me user.
isCancelled()booleanWhether entry is denied.
setCancelled(boolean)voidDeny or allow the attempt.
@EventHandler
public void onJoinAttempt(PlayerJoinAttemptEvent event) {
if (maintenanceArenas.contains(event.getGame().getArena().getId())) {
event.setCancelled(true);
event.getPlayer().sendMessage("This arena is under maintenance.");
}
}