GameType
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.world.GameType;
Implements
GameType
implements the following interfaces:
Undocumented Interfaces
Comparable<Enum>
Enum Constants
GameType is an enum with 4 constants. They are accessible like so:
// GameType.ADVENTURE<constant:minecraft:world/gametype:adventure>// GameType.CREATIVE<constant:minecraft:world/gametype:creative>// GameType.SPECTATOR<constant:minecraft:world/gametype:spectator>// GameType.SURVIVAL<constant:minecraft:world/gametype:survival>
Members
Getter
// GameType.id as int<constant:minecraft:world/gametype:adventure>.id
Return Type:
int
id() as int
// GameType.id() as int;<constant:minecraft:world/gametype:adventure>.id();
Return Type:
int
Getter
// GameType.isBlockPlacingRestricted as bool<constant:minecraft:world/gametype:adventure>.isBlockPlacingRestricted
Return Type:
bool
isBlockPlacingRestricted() as bool
// GameType.isBlockPlacingRestricted() as bool;<constant:minecraft:world/gametype:adventure>.isBlockPlacingRestricted();
Return Type:
bool
Getter
// GameType.isCreative as bool<constant:minecraft:world/gametype:adventure>.isCreative
Return Type:
bool
isCreative() as bool
// GameType.isCreative() as bool;<constant:minecraft:world/gametype:adventure>.isCreative();
Return Type:
bool
Getter
// GameType.isSurvival as bool<constant:minecraft:world/gametype:adventure>.isSurvival
Return Type:
bool
isSurvival() as bool
// GameType.isSurvival() as bool;<constant:minecraft:world/gametype:adventure>.isSurvival();
Return Type:
bool
Getter
longDisplayName() as Component
Getter
// GameType.name as string<constant:minecraft:world/gametype:adventure>.name
Return Type:
string
name() as string
// GameType.name() as string;<constant:minecraft:world/gametype:adventure>.name();
Return Type:
string
Getter
Gets the serialized name.script.zs
// GameType.serializedName as string<constant:minecraft:world/gametype:adventure>.serializedName
Return Type:
string
serializedName() as string
Gets the serialized name.script.zs
Returns: the serialized name.
// GameType.serializedName() as string;<constant:minecraft:world/gametype:adventure>.serializedName();
Return Type:
string
Getter
shortDisplayName() as Component