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.mods.Mods;Methods
Gets a specific mod
Returns: a specific MCModInfo
Return Type: ModInfo
// Mods.getMod(modid as string) as ModInfo
loadedMods.getMod("minecraft");| Parameter | Type | Description | 
|---|---|---|
| Parametermodid | Typestring | DescriptionNo Description Provided | 
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 | 
|---|---|---|
| Parametermodid | Typestring | Descriptionmodid to check | 
Properties
| Name | Type | Has Getter | Has Setter | Description | 
|---|---|---|---|---|
| Namemods | Typestdlib.List<ModInfo> | Has Gettertrue | Has Setterfalse | DescriptionGets a list of all mods in the game | 
| Namesize | Typeint | Has Gettertrue | Has Setterfalse | DescriptionGets the amount of mods loaded |