Enum Class GameMode
- All Implemented Interfaces:
Serializable, Comparable<GameMode>, Constable
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLike survival, but blocks can only be broken or placed where items allow it.Players fly, are invulnerable and have unlimited blocks.Players fly through blocks and cannot interact with the world.Players gather resources, take damage and can die. -
Method Summary
Modifier and TypeMethodDescriptionbyId(int id) Returns the game mode with a protocol identifier, ornullif there is none.Parses a game mode as typed in a command.intid()Returns the protocol identifier of this game mode.static GameModeReturns the enum constant of this class with the specified name.static GameMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SURVIVAL
Players gather resources, take damage and can die. -
CREATIVE
Players fly, are invulnerable and have unlimited blocks. -
ADVENTURE
Like survival, but blocks can only be broken or placed where items allow it. -
SPECTATOR
Players fly through blocks and cannot interact with the world.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
byId
-
byName
Parses a game mode as typed in a command.Accepts the English name, its French translation, the usual abbreviation (
s,c,a,sp) or the protocol identifier, ignoring case.- Parameters:
input- the text to parse- Returns:
- the game mode, or
nullif the text matches none - Since:
- 0.1.0
-
id
public int id()Returns the protocol identifier of this game mode.- Returns:
- the protocol identifier of this game mode
- Since:
- 0.1.0
-