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
-
Constructor Summary
-
Method Summary
Modifier and Type Method Description static GameMode
byId(int id)
static GameMode
byId(int id, GameMode defaultMode)
static GameMode
byName(String name)
static GameMode
byName(String name, GameMode defaultMode)
int
getId()
String
getName()
Text
getTranslatableName()
boolean
isBlockBreakingRestricted()
boolean
isCreative()
boolean
isSurvivalLike()
void
setAbilities(PlayerAbilities abilities)
static GameMode
valueOf(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
-
NOT_SET
-
SURVIVAL
-
CREATIVE
-
ADVENTURE
-
SPECTATOR
-
-
Field Details
-
id
private final int id -
name
-
-
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
-
setAbilities
-
isBlockBreakingRestricted
public boolean isBlockBreakingRestricted() -
isCreative
public boolean isCreative() -
isSurvivalLike
public boolean isSurvivalLike() -
byId
-
byId
-
byName
-
byName
-