保存所有注册模组的信息。 可以使用 加载模组 全局关键字 访问

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.mod.Mods;

Name: getMod

Gets a specific mod

Returns: a specific Mod
Return Type: Mod?

ZenScript
Copy
// Mods.getMod(modid as string) as Mod?

loadedMods.getMod("minecraft");
参数类型
参数
modid
类型
string

Name: getMods

Gets a list of all mods in the game

Returns: list of Mod
Return Type: stdlib.List<Mod>

ZenScript
Copy
// Mods.getMods() as stdlib.List<Mod>

loadedMods.getMods();

Name: getSize

Gets the amount of mods loaded

Returns: The amount of mods that are loaded
Return Type: int

ZenScript
Copy
// Mods.getSize() as int

loadedMods.getSize();

Name: isModLoaded

Checks if a mod is laoded

Returns: true if the mod is loaded
Return Type: boolean

ZenScript
Copy
// Mods.isModLoaded(modid as string) as boolean

loadedMods.isModLoaded("minecraft");
参数类型描述
参数
modid
类型
string
描述
摩托车检查

Name: INDEXGET

ZenScript
Copy
[myMods]

Name: MEMBERGETTER

Gets a specific mod

ZenScript
Copy
myMods.modid as string
loadedMods."minecraft"
名称类型可获得可设置描述
名称
模组
类型
stdlib.List<Mod>
可获得
true
可设置
false
描述
Gets a list of all mods in the game
名称
size #大小
类型
int
可获得
true
可设置
false
描述
Gets the amount of mods loaded