Mods
Holds information on all the mods that are registered.
Can be accessed using the loadedMods
global keyword
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.
import crafttweaker.api.mod.Mods;
Methods
Gets a specific mod
Returns: a specific Mod
Return Type: Mod?
// Mods.getMod(modid as string) as Mod?
loadedMods.getMod("minecraft");
Parameter | Type |
---|---|
Parameter modid | Type string |
Gets a list of all mods in the game
Returns: list of Mod
Return Type: stdlib.List<Mod>
// Mods.getMods() as stdlib.List<Mod>
loadedMods.getMods();
Gets the amount of mods loaded
Returns: The amount of mods that are loaded
Return Type: int
// Mods.getSize() as int
loadedMods.getSize();
Checks if a mod is laoded
Returns: true if the mod is loaded
Return Type: boolean
// Mods.isModLoaded(modid as string) as boolean
loadedMods.isModLoaded("minecraft");
Parameter | Type | Description |
---|---|---|
Parameter modid | Type string | Description modid to check |
Operators
[myMods]
Gets a specific mod
myMods.modid as stringloadedMods."minecraft"
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name mods | Type stdlib.List<Mod> | Has Getter true | Has Setter false | Description Gets a list of all mods in the game |
Name size | Type int | Has Getter true | Has Setter false | Description Gets the amount of mods loaded |