类 PlayerEvent.PlayerChangeGameModeEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
封闭类:
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.
  • 字段详细资料

    • currentGameMode

      private final GameType currentGameMode
    • newGameMode

      private GameType newGameMode
  • 构造器详细资料

    • PlayerChangeGameModeEvent

      public PlayerChangeGameModeEvent(Player player, GameType currentGameMode, GameType newGameMode)
  • 方法详细资料

    • 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.