Serializable
, Comparable<GameMode>
public enum GameMode extends Enum<GameMode>
HumanEntity
s may
haveEnum Constant | Description |
---|---|
ADVENTURE |
Adventure mode cannot break blocks without the correct tools.
|
CREATIVE |
Creative mode may fly, build instantly, become invulnerable and create
free items.
|
SPECTATOR |
Spectator mode cannot interact with the world in anyway and is
invisible to normal players.
|
SURVIVAL |
Survival mode is the "normal" gameplay type, with no special features.
|
Modifier and Type | Method | Description |
---|---|---|
static @Nullable GameMode |
getByValue(int value) |
Deprecated.
Magic value
|
int |
getValue() |
Deprecated.
Magic value
|
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.
|
public static final GameMode CREATIVE
public static final GameMode SURVIVAL
public static final GameMode ADVENTURE
public static final GameMode SPECTATOR
public static GameMode[] values()
for (GameMode c : GameMode.values()) System.out.println(c);
public static GameMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@Deprecated public int getValue()
@Deprecated @Nullable public static @Nullable GameMode getByValue(int value)
value
- Value to checkGameMode
with the given value, or null if
it doesn't existCopyright © 2020. All rights reserved.