Импорт класса

Link to импорт-класса

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.world.GameType;

GameType is an enum. It has 4 enum constants. They are accessible using the code below.

ZenScript
Copy
GameType.SURVIVAL
GameType.CREATIVE
GameType.ADVENTURE
GameType.SPECTATOR

Name: getId

Return Type: int

ZenScript
Copy
// GameType.getId() as int

myGameType.getId();

Link to getLongDisplayName

Name: getLongDisplayName

Return Type: Component

ZenScript
Copy
// GameType.getLongDisplayName() as Component

myGameType.getLongDisplayName();

Name: getName

Return Type: string

ZenScript
Copy
// GameType.getName() as string

myGameType.getName();

Link to getShortDisplayName

Name: getShortDisplayName

Return Type: Component

ZenScript
Copy
// GameType.getShortDisplayName() as Component

myGameType.getShortDisplayName();

Link to isBlockPlacingRestricted

Name: isBlockPlacingRestricted

Return Type: boolean

ZenScript
Copy
// GameType.isBlockPlacingRestricted() as boolean

myGameType.isBlockPlacingRestricted();

Name: isCreative

Return Type: boolean

ZenScript
Copy
// GameType.isCreative() as boolean

myGameType.isCreative();

Name: isSurvival

Return Type: boolean

ZenScript
Copy
// GameType.isSurvival() as boolean

myGameType.isSurvival();

Link to updatePlayerAbilities

Name: updatePlayerAbilities

Return Type: void

ZenScript
Copy
GameType.updatePlayerAbilities(abilities as Abilities) as void
ПараметрТипОписание
Параметр
abilities
Тип
Abilities
Описание
No Description Provided

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
id
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
isBlockPlacingRestricted
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
isCreative
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
isSurvival
Тип
boolean
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
longDisplayName
Тип
Component
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
name
Тип
string
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided
Название
shortDisplayName
Тип
Component
Имеет Getter
true
Имеет Setter
false
Описание
No Description Provided