Class GameStateChangeEvent

java.lang.Object
org.bukkit.event.Event
dev.despical.tntrun.api.event.TNTRunEvent
dev.despical.tntrun.api.event.game.GameEvent
dev.despical.tntrun.api.event.game.GameStateChangeEvent
All Implemented Interfaces:
org.bukkit.event.Cancellable

public class GameStateChangeEvent extends GameEvent implements org.bukkit.event.Cancellable
Called immediately before a TNTRun game changes state.

The game is still in the old state when this event is fired. Cancelling the event prevents the new state from being applied, so the target state's first tick will not run.

Typical use cases:

  • Blocking a transition under custom conditions
  • Logging state changes for analytics or debugging
  • Running custom logic before a state handler starts
See Also:
  • 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
    GameStateChangeEvent(Game game, GameState oldState, GameState newState)
    Constructs a new GameStateChangeEvent.
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.bukkit.event.HandlerList
     
    @NotNull org.bukkit.event.HandlerList
     

    Methods inherited from class GameEvent

    getArena, 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

    Methods inherited from interface org.bukkit.event.Cancellable

    isCancelled, setCancelled
  • Constructor Details

    • GameStateChangeEvent

      public GameStateChangeEvent(Game game, GameState oldState, GameState newState)
      Constructs a new GameStateChangeEvent.
      Parameters:
      game - the game instance
      oldState - the current state before the transition
      newState - the state the game is about to enter
  • Method Details

    • 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()