Class GameEndEvent

java.lang.Object
org.bukkit.event.Event

public final class GameEndEvent extends GameEvent
Called when a Whack Me run reaches its normal ending phase.

Point generation has stopped, but result persistence and player cleanup have not run yet. The game still contains its user, so temporary run statistics and getFinalScore() are available to listeners.

 @EventHandler
 public void onGameEnd(GameEndEvent event) {
     analytics.recordScore(event.getGame().getUser().getUUID(),
         event.getFinalScore());
 }
 
API note: This event is fired before personal/arena records are updated and before temporary statistics are reset. It is not fired for force-stopped games; use GameStopEvent for that lifecycle.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.bukkit.event.Event

    org.bukkit.event.Event.Result
  • Field Summary

    Fields inherited from class GameEvent

    game
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a normal game end event.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the score accumulated during the completed run.
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList

    Methods inherited from class GameEvent

    getArena, getGame, toString

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, isAsynchronous

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GameEndEvent

      public GameEndEvent(Game game)
      Creates a normal game end event.
      Parameters:
      game - game that reached its ending phase
  • Method Details

    • getFinalScore

      public int getFinalScore()
      Returns the score accumulated during the completed run.
      Returns:
      final local score, or 0 if the game no longer has a user
    • getHandlers

      @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()
      Specified by:
      getHandlers in class org.bukkit.event.Event
    • getHandlerList

      public static org.bukkit.event.HandlerList getHandlerList()