Home Commands Examples Getting Started With Scripts Global Keywords

Game

Importing the class

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.

script.zs
import crafttweaker.api.game.Game;

Methods

Return Type: Collection<BlockState>

script.zs
// Game.getBlockStates() as Collection<BlockState>
myGame.getBlockStates();

Return Type: Collection<Block>

script.zs
// Game.getBlocks() as Collection<Block>
myGame.getBlocks();

Return Type: Collection<Enchantment>

script.zs
// Game.getEnchantments() as Collection<Enchantment>
myGame.getEnchantments();

Return Type: Collection<EntityType>

script.zs
// Game.getEntityTypes() as Collection<EntityType>
myGame.getEntityTypes();

Return Type: Collection<Fluid>

script.zs
// Game.getFluids() as Collection<Fluid>
myGame.getFluids();

Return Type: Collection<IItemStack>

script.zs
// Game.getItemStacks() as Collection<IItemStack>
myGame.getItemStacks();

Return Type: Collection<MobEffect>

script.zs
// Game.getMobEffects() as Collection<MobEffect>
myGame.getMobEffects();

Return Type: Collection<Potion>

script.zs
// Game.getPotions() as Collection<Potion>
myGame.getPotions();

Return Type: Collection<IRecipeManager>

script.zs
// Game.getRecipeTypes() as Collection<IRecipeManager>
myGame.getRecipeTypes();

Return Type: Collection<VillagerProfession>

script.zs
// Game.getVillagerProfessions() as Collection<VillagerProfession>
myGame.getVillagerProfessions();

Returns: a localized String
Return Type: string

script.zs
// Game.localize(translationKey as string) as string
myGame.localize("gui.up");
ParameterType
Parameter
translationKey
Type
string

Properties

NameTypeHas GetterHas Setter
Name
blockStates
Type
Collection<BlockState>
Has Getter
true
Has Setter
false
Name
blocks
Type
Collection<Block>
Has Getter
true
Has Setter
false
Name
effects
Type
Collection<MobEffect>
Has Getter
true
Has Setter
false
Name
enchantments
Type
Collection<Enchantment>
Has Getter
true
Has Setter
false
Name
entityTypes
Type
Collection<EntityType>
Has Getter
true
Has Setter
false
Name
fluids
Type
Collection<Fluid>
Has Getter
true
Has Setter
false
Name
items
Type
Collection<IItemStack>
Has Getter
true
Has Setter
false
Name
potions
Type
Collection<Potion>
Has Getter
true
Has Setter
false
Name
recipeTypes
Type
Collection<IRecipeManager>
Has Getter
true
Has Setter
false
Name
villagerProfessions
Type
Collection<VillagerProfession>
Has Getter
true
Has Setter
false