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.

script.zs
import crafttweaker.api.world.GameType;

Implements

GameType implements the following interfaces:

StringRepresentable

Undocumented Interfaces

Comparable<Enum>

Enum Constants

GameType is an enum with 4 constants. They are accessible like so:

script.zs
// 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
script.zs
// GameType.id as int
<constant:minecraft:world/gametype:adventure>.id

Return Type: int

id() as int
script.zs
// GameType.id() as int;
<constant:minecraft:world/gametype:adventure>.id();

Return Type: int

Getter
script.zs
// GameType.isBlockPlacingRestricted as bool
<constant:minecraft:world/gametype:adventure>.isBlockPlacingRestricted

Return Type: bool

isBlockPlacingRestricted() as bool
script.zs
// GameType.isBlockPlacingRestricted() as bool;
<constant:minecraft:world/gametype:adventure>.isBlockPlacingRestricted();

Return Type: bool

Getter
script.zs
// GameType.isCreative as bool
<constant:minecraft:world/gametype:adventure>.isCreative

Return Type: bool

isCreative() as bool
script.zs
// GameType.isCreative() as bool;
<constant:minecraft:world/gametype:adventure>.isCreative();

Return Type: bool

Getter
script.zs
// GameType.isSurvival as bool
<constant:minecraft:world/gametype:adventure>.isSurvival

Return Type: bool

isSurvival() as bool
script.zs
// GameType.isSurvival() as bool;
<constant:minecraft:world/gametype:adventure>.isSurvival();

Return Type: bool

Getter
script.zs
// GameType.longDisplayName as Component
<constant:minecraft:world/gametype:adventure>.longDisplayName

Return Type: Component

longDisplayName() as Component
script.zs
// GameType.longDisplayName() as Component;
<constant:minecraft:world/gametype:adventure>.longDisplayName();

Return Type: Component

Getter
script.zs
// GameType.name as string
<constant:minecraft:world/gametype:adventure>.name

Return Type: string

name() as string
script.zs
// 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.

Returns: the serialized name.

script.zs
// GameType.serializedName() as string;
<constant:minecraft:world/gametype:adventure>.serializedName();

Return Type: string

Getter
script.zs
// GameType.shortDisplayName as Component
<constant:minecraft:world/gametype:adventure>.shortDisplayName

Return Type: Component

shortDisplayName() as Component
script.zs
// GameType.shortDisplayName() as Component;
<constant:minecraft:world/gametype:adventure>.shortDisplayName();

Return Type: Component

updatePlayerAbilities(abilities as Abilities)
script.zs
// GameType.updatePlayerAbilities(abilities as Abilities);
<constant:minecraft:world/gametype:adventure>.updatePlayerAbilities(myAbilities);

Parameters:

abilities Type: Abilities