Package org.bukkit
Enum Class GameMode
- All Implemented Interfaces:
Serializable
,Comparable<GameMode>
,Constable
Represents the various type of game modes that
HumanEntity
s may
have-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionAdventure mode cannot break blocks without the correct tools.Creative mode may fly, build instantly, become invulnerable and create free items.Spectator mode cannot interact with the world in anyway and is invisible to normal players.Survival mode is the "normal" gameplay type, with no special features. -
Method Summary
Modifier and TypeMethodDescriptiongetByValue
(int value) Deprecated.Magic valueint
getValue()
Deprecated.Magic valuestatic GameMode
Returns 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
-
CREATIVE
Creative mode may fly, build instantly, become invulnerable and create free items. -
SURVIVAL
Survival mode is the "normal" gameplay type, with no special features. -
ADVENTURE
Adventure mode cannot break blocks without the correct tools. -
SPECTATOR
Spectator mode cannot interact with the world in anyway and is invisible to normal players. This grants the player the ability to no-clip through 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
-
getValue
Deprecated.Magic valueGets the mode value associated with this GameMode- Returns:
- An integer value of this gamemode
-
getByValue
Deprecated.Magic valueGets the GameMode represented by the specified value- Parameters:
value
- Value to check- Returns:
- Associative
GameMode
with the given value, or null if it doesn't exist
-