Enum Class GameType

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

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

    • SURVIVAL

      public static final GameType SURVIVAL
    • CREATIVE

      public static final GameType CREATIVE
    • ADVENTURE

      public static final GameType ADVENTURE
    • SPECTATOR

      public static final GameType SPECTATOR
  • Field Details

    • DEFAULT_MODE

      public static final GameType DEFAULT_MODE
    • NOT_SET

      private static final int NOT_SET
      See Also:
      Constant Field Values
    • id

      private final int id
    • name

      private final String name
    • shortName

      private final Component shortName
    • longName

      private final Component longName
  • Constructor Details

    • GameType

      private GameType(int p_46390_, String p_46391_)
  • Method Details

    • values

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

      public static GameType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • getId

      public int getId()
    • getName

      public String getName()
    • getLongDisplayName

      public Component getLongDisplayName()
    • getShortDisplayName

      public Component getShortDisplayName()
    • updatePlayerAbilities

      public void updatePlayerAbilities(Abilities p_46399_)
    • isBlockPlacingRestricted

      public boolean isBlockPlacingRestricted()
    • isCreative

      public boolean isCreative()
    • isSurvival

      public boolean isSurvival()
    • byId

      public static GameType byId(int p_46394_)
    • byId

      public static GameType byId(int p_46396_, GameType p_46397_)
    • byName

      public static GameType byName(String p_46401_)
    • byName

      public static GameType byName(String p_46403_, GameType p_46404_)
    • getNullableId

      public static int getNullableId(@Nullable GameType p_151496_)
    • byNullableId

      @Nullable public static GameType byNullableId(int p_151498_)