Package net.minecraft.world
Enum GameMode
- All Implemented Interfaces:
Serializable,Comparable<GameMode>,java.lang.constant.Constable
public enum GameMode extends Enum<GameMode>
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
-
Field Summary
Fields Modifier and Type Field Description static GameModeDEFAULTprivate intidprivate Stringnameprivate TextsimpleTranslatableNameprivate TexttranslatableName -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static GameModebyId(int id)static GameModebyId(int id, GameMode defaultMode)static GameModebyName(String name)static GameModebyName(String name, GameMode defaultMode)intgetId()static intgetId(GameMode gameMode)StringgetName()static GameModegetOrNull(int id)TextgetSimpleTranslatableName()TextgetTranslatableName()booleanisBlockBreakingRestricted()booleanisCreative()booleanisSurvivalLike()voidsetAbilities(PlayerAbilities abilities)static GameModevalueOf(String name)Returns the enum constant of this type with the specified name.static GameMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
SURVIVAL
-
CREATIVE
-
ADVENTURE
-
SPECTATOR
-
-
Field Details
-
DEFAULT
-
id
private final int id -
name
-
simpleTranslatableName
-
translatableName
-
-
Constructor Details
-
GameMode
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getId
public int getId() -
getName
-
getTranslatableName
-
getSimpleTranslatableName
-
setAbilities
-
isBlockBreakingRestricted
public boolean isBlockBreakingRestricted() -
isCreative
public boolean isCreative() -
isSurvivalLike
public boolean isSurvivalLike() -
byId
-
byId
-
byName
-
byName
-
getId
-
getOrNull
-