org.bukkit
Enum GameMode

java.lang.Object
  extended by java.lang.Enum<GameMode>
      extended by org.bukkit.GameMode
All Implemented Interfaces:
Serializable, Comparable<GameMode>

public enum GameMode
extends Enum<GameMode>

Represents the various type of game modes that HumanEntitys may have


Enum Constant Summary
ADVENTURE
          Adventure mode cannot break blocks, use chat, use buckets, etc.
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.
 
Method Summary
static GameMode getByValue(int value)
          Gets the GameMode represented by the specified value
 int getValue()
          Gets the mode value associated with this GameMode
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're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

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, use chat, use buckets, etc.

Method Detail

values

public static final GameMode[] values()
Returns an array containing the constants of this enum type, in the order they're 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're 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 name

getValue

public int getValue()
Gets the mode value associated with this GameMode

Returns:
An integer value of this gamemode

getByValue

public static GameMode getByValue(int value)
Gets 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


Copyright © 2013. All Rights Reserved.