Enum GameMode

java.lang.Object
java.lang.Enum<GameMode>
net.minecraft.world.GameMode
All Implemented Interfaces:
Serializable, Comparable<GameMode>, java.lang.constant.Constable

public enum GameMode
extends Enum<GameMode>
  • Enum Constant Details

    • NOT_SET

      public static final GameMode NOT_SET
    • SURVIVAL

      public static final GameMode SURVIVAL
    • CREATIVE

      public static final GameMode CREATIVE
    • ADVENTURE

      public static final GameMode ADVENTURE
    • SPECTATOR

      public static final GameMode SPECTATOR
  • Field Details

    • id

      private final int id
    • name

      private final String name
  • Constructor Details

    • GameMode

      private GameMode​(int id, String name)
  • Method Details

    • values

      public static GameMode[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static GameMode valueOf​(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public int getId()
    • getName

      public String getName()
    • getTranslatableName

      public Text getTranslatableName()
    • setAbilities

      public void setAbilities​(PlayerAbilities abilities)
    • isBlockBreakingRestricted

      public boolean isBlockBreakingRestricted()
    • isCreative

      public boolean isCreative()
    • isSurvivalLike

      public boolean isSurvivalLike()
    • byId

      public static GameMode byId​(int id)
    • byId

      public static GameMode byId​(int id, GameMode defaultMode)
    • byName

      public static GameMode byName​(String name)
    • byName

      public static GameMode byName​(String name, GameMode defaultMode)