GameType
Link to gametype
Importare la Classe
Link to importare-la-classe
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 Copyimport crafttweaker.api.world.GameType;
Enum Constants
Link to enum-constants
GameType is an enum. It has 4 enum constants. They are accessible using the code below.
ZenScript CopyGameType.SURVIVAL
GameType.CREATIVE
GameType.ADVENTURE
GameType.SPECTATOR
Metodi
Link to metodi
Name: getId
Return Type: int
ZenScript Copy// GameType.getId() as int
myGameType.getId();
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();
Name: getShortDisplayName
Return Type: Component
ZenScript Copy// GameType.getShortDisplayName() as Component
myGameType.getShortDisplayName();
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();
Name: updatePlayerAbilities
Return Type: void
ZenScript CopyGameType.updatePlayerAbilities(abilities as Abilities) as void
Parametro | Tipo | Descrizione |
---|---|---|
Parametro abilities | Tipo Abilities | Descrizione No Description Provided |
Proprietà
Link to proprietà
Nome | Tipo | Ha Getter | Ha Setter | Descrizione |
---|---|---|---|---|
Nome id | Tipo int | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome isBlockPlacingRestricted | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome isCreative | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome isSurvival | Tipo boolean | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome longDisplayName | Tipo Component | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome nome | Tipo string | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |
Nome shortDisplayName | Tipo Component | Ha Getter sì | Ha Setter no | Descrizione No Description Provided |