Package org.bukkit
Enum GameMode
- java.lang.Object
-
- java.lang.Enum<GameMode>
-
- org.bukkit.GameMode
-
- All Implemented Interfaces:
Serializable
,Comparable<GameMode>
public enum GameMode extends Enum<GameMode>
Represents the various type of game modes thatHumanEntity
s may have
-
-
Enum Constant Summary
Enum Constants Enum 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static GameMode
getByValue(int value)
Deprecated.Magic valueint
getValue()
Deprecated.Magic valuestatic 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 Detail
-
CREATIVE
public static final GameMode CREATIVE
Creative mode may fly, build instantly, become invulnerable and create free items.
-
SURVIVAL
public static final GameMode SURVIVAL
Survival mode is the "normal" gameplay type, with no special features.
-
ADVENTURE
public static final GameMode ADVENTURE
Adventure mode cannot break blocks without the correct tools.
-
SPECTATOR
public static final GameMode 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 Detail
-
values
public static GameMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GameMode c : GameMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GameMode valueOf(String name)
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
-
getValue
@Deprecated public int getValue()
Deprecated.Magic valueGets the mode value associated with this GameMode- Returns:
- An integer value of this gamemode
-
getByValue
@Deprecated @Nullable public static GameMode getByValue(int value)
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
-
-