Mods

Holds information on all the mods that are registered. Can be accessed using the loadedMods global keyword

This class was added by a mod with mod-id crafttweaker. So you need to have this mod installed if you want to use this feature.

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.

crafttweaker.api.mods.Mods

Methods

getMod

Gets a specific mod

Returns: a specific MCModInfo

Return type: crafttweaker.api.mods.ModInfo

loadedMods.getMod(modid as String);
loadedMods.getMod("minecraft");
ParameterTypeDescription
modidStringNo description provided

isModLoaded

Checks if a mod is laoded

Returns: true if the mod is loaded

Return type: boolean

loadedMods.isModLoaded(modid as String);
loadedMods.isModLoaded("minecraft");
ParameterTypeDescription
modidStringmodid to check

Properties

NameTypeHas GetterHas Setter
modsList<crafttweaker.api.mods.ModInfo>truefalse
sizeinttruefalse