Game Class
Link to game-class
The IGame Class is used to obtain general game information. Can be accessed using game
导入相关包
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.
import crafttweaker.game.IGame;
Zengetters
Link to zengetters
Zengetter | What does it do? | 返回值类型 | Usage |
---|---|---|---|
Zengetter biomes | What does it do? Returns all registered biomes as list | 返回值类型 List<IBiomes> | Usage game.biomes |
Zengetter blocks | What does it do? Returns all registered blocks as list | 返回值类型 List<IBlockDefinition> | Usage game.blocks |
Zengetter enchantments | What does it do? Returns all registered enchantments as list | 返回值类型 List<IEnchantmentDefinition> | Usage game.enchantments |
Zengetter entities | What does it do? Returns all registered entities as list | 返回值类型 List<IEntityDefinition> | Usage game.entities |
Zengetter items | What does it do? Returns all registered items as list | 返回值类型 List<IItemDefinition> | Usage game.items |
Zengetter liquids | What does it do? Returns all registered liquids as list | 返回值类型 List<ILiquidDefinition> | Usage game.liquids |
Zengetter potions | What does it do? Returns all registered potions as list | 返回值类型 List<IPotion> | Usage game.potions |
使用方式
Link to 使用方式
GetEntity
Link to getentity
ZenScript Copy//getEntity(EntityName)
//essentially the same
val sheep = game.getEntity("sheep");
val sheep1 = <entity:minecraft:sheep>;
SetLocalization
Link to setlocalization
Sets the localization.
All parameters are strings. game.setLocalization(key, value);
game.setLocalization(lang, key, value);
Localize
Link to localize
Returns a localized String
game.localize(key)
game.localize(key, lang)