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

    • 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

    • field_28045

      public static final GameMode field_28045
    • id

      private final int id
    • name

      private final String name
    • field_28046

      private final Text field_28046
    • field_28047

      private final Text field_28047
  • 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()
    • method_32763

      @Environment(CLIENT) public Text method_32763()
    • 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)
    • method_32761

      public static int method_32761​(@Nullable GameMode gameMode)
    • method_32762

      @Nullable public static GameMode method_32762​(int int2)