Represents the various kinds of game modes that are available within the game.

A game mode indicates how the player should experience the game and with which restrictions. Refer to the documentation of the various entries for a description.

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

ZenScript
Copy
import crafttweaker.api.predicate.GameMode;

Extending Enum<GameMode>

Link to extending-enumgamemode

GameMode extends Enum<GameMode>. That means all methods available in Enum<GameMode> are also available in GameMode

Static Properties

Link to static-properties

名称类型可获得可设置描述
名称
ADVENTURE
类型
GameMode
可获得
true
可设置
false
描述
The adventure game mode. <br /> <br /> In this game mode, the player is restricted in its actions, being able to only walk around the world, and fight <br /> against enemies. While the player still needs to handle both health and hunger, it cannot break nor place any <br /> blocks unless specifically enabled to do so by the game itself.
名称
CREATIVE
类型
GameMode
可获得
true
可设置
false
描述
The creative game mode. <br /> <br /> In this game mode, the first one to be added to the game, the player is able to obtain unlimited amount of <br /> resources from the menu, along with breaking and placing blocks as they see fit. There is no hunger nor health <br /> and no enemies to worry about. The player is also free to fly around in the world, though cannot clip through <br /> blocks.
名称
SPECTATOR
类型
GameMode
可获得
true
可设置
false
描述
The spectator game mode. <br /> <br /> In this game mode, the player is not able to interact with the world, but it is effectively unrestricted in its <br /> movements, allowing both flying and no-clip through blocks. It is also the only game mode in which players can <br /> assume the point of view (i.e. spectate) other entities, including other players.
名称
SURVIVAL
类型
GameMode
可获得
true
可设置
false
描述
The survival game mode. <br /> <br /> In this game mode, the player needs to worry about survival, be it fighting enemies, gathering resources to <br /> survive, or simply exploring. The player is restricted in its movements and has to worry about both health and <br /> hunger. Resources need also to be gathered from the game world.