Class GameEvent

java.lang.Object
org.bukkit.event.Event
dev.despical.whackme.api.event.WhackMeEvent
dev.despical.whackme.api.event.game.GameEvent
Direct Known Subclasses:
GameEndEvent, GameStartEvent, GameStateChangeEvent, GameStopEvent

public abstract class GameEvent extends WhackMeEvent
Base class for events associated with one Whack Me game session.

The related Game provides access to the player, point handler, scoreboard, boss bar, timer, state, and arena configuration. The exact lifecycle guarantees depend on the concrete event. API note: A Game is a live runtime object. Do not mutate it from asynchronous event handlers.

  • Nested Class Summary

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected final Game
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a game-scoped Whack Me event.
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull Arena
    Returns the arena that owns the related game.
    final Game
    Returns the live game associated with this event.
    Returns a compact representation suitable for profiler output.

    Methods inherited from class org.bukkit.event.Event

    callEvent, getEventName, getHandlers, isAsynchronous

    Methods inherited from class Object

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

    • game

      protected final Game game
  • Constructor Details

    • GameEvent

      protected GameEvent(Game game)
      Creates a game-scoped Whack Me event.
      Parameters:
      game - game associated with the event
  • Method Details

    • getGame

      public final Game getGame()
      Returns the live game associated with this event.
      Returns:
      related game
    • getArena

      @NotNull public @NotNull Arena getArena()
      Returns the arena that owns the related game.
      Returns:
      game arena
    • toString

      public String toString()
      Returns a compact representation suitable for profiler output.
      Overrides:
      toString in class Object
      Returns:
      arena detail string