Class PlayerEvent.PlayerChangeGameModeEvent

  • Enclosing class:
    PlayerEvent

    public static class PlayerEvent.PlayerChangeGameModeEvent
    extends PlayerEvent
    Fired when the game type of a server player is changed to a different value than what it was previously. Eg Creative to Survival, not Survival to Survival. If the event is cancelled the game mode of the player is not changed and the value of newGameMode is ignored.
    • Field Detail

      • currentGameMode

        private final GameType currentGameMode
      • newGameMode

        private GameType newGameMode
    • Constructor Detail

    • Method Detail

      • getCurrentGameMode

        public GameType getCurrentGameMode()
      • getNewGameMode

        public GameType getNewGameMode()
      • setNewGameMode

        public void setNewGameMode​(GameType newGameMode)
        Sets the game mode the player will be changed to if this event is not cancelled.