# Uses of Enum Class
org.bukkit.GameMode

Packages that use GameMode
Package
Description
org.bukkit
The root package of the Bukkit API, contains generalized API classes.
org.bukkit.entity
Interfaces for non-voxel objects that can exist in a `world`, including all players, monsters, projectiles, etc.
org.bukkit.event.player
`Events` relating to `players`.

## Uses of GameMode in org.bukkit

Methods in org.bukkit that return GameMode
Modifier and Type
Method
Description
`static @Nullable GameMode`
GameMode.`getByValue(int value)`
Deprecated.
Magic value
`static @NotNull GameMode`
Bukkit.`getDefaultGameMode()`
Gets the default `GameMode` for new players.
`@NotNull GameMode`
Server.`getDefaultGameMode()`
Gets the default `GameMode` for new players.
`static GameMode`
GameMode.`valueOf(String name)`
Returns the enum constant of this class with the specified name.
`static GameMode[]`
GameMode.`values()`
Returns an array containing the constants of this enum class, in the order they are declared.
Methods in org.bukkit with parameters of type GameMode
Modifier and Type
Method
Description
`static void`
Bukkit.`setDefaultGameMode(@NotNull GameMode mode)`
Sets the default `GameMode` for new players.
`void`
Server.`setDefaultGameMode(@NotNull GameMode mode)`
Sets the default `GameMode` for new players.

## Uses of GameMode in org.bukkit.entity

Methods in org.bukkit.entity that return GameMode
Modifier and Type
Method
Description
`@NotNull GameMode`
HumanEntity.`getGameMode()`
Gets this human's current `GameMode`
`@Nullable GameMode`
Player.`getPreviousGameMode()`
Gets this player's previous `GameMode`
Methods in org.bukkit.entity with parameters of type GameMode
Modifier and Type
Method
Description
`void`
HumanEntity.`setGameMode(@NotNull GameMode mode)`
Sets this human's current `GameMode`

## Uses of GameMode in org.bukkit.event.player

Methods in org.bukkit.event.player that return GameMode
Modifier and Type
Method
Description
`@NotNull GameMode`
PlayerGameModeChangeEvent.`getNewGameMode()`
Gets the GameMode the player is switched to.
Constructors in org.bukkit.event.player with parameters of type GameMode
Modifier
Constructor
Description
``
`PlayerGameModeChangeEvent(@NotNull Player player, @NotNull GameMode newGameMode)`
Deprecated.
``
`PlayerGameModeChangeEvent(@NotNull Player player, @NotNull GameMode newGameMode, @NotNull PlayerGameModeChangeEvent.Cause cause, Component cancelMessage)`