Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

Module

This class was added by a mod with mod-id mekanism. 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 at the very top of the file.

script.zs
import mods.mekanism.api.gear.Module;

Methods

Gets the data/module type of this module instance.

Returns: The data/module type of this module instance.
Return Type: ModuleData

script.zs
// Module.getData() as ModuleData
myModule.getData();

Gets the number of installed modules of this type.

Returns: The number of installed modules of this type.
Return Type: int

script.zs
// Module.getInstalledCount() as int
myModule.getInstalledCount();

Gets if this module is currently enabled in the Module Tweaker.

Returns: true if this module is enabled. Return Type: boolean

script.zs
// Module.isEnabled() as boolean
myModule.isEnabled();

Properties

NameTypeHas GetterHas SetterDescription
Name
data
Type
ModuleData
Has Getter
true
Has Setter
false
Description
Gets the data/module type of this module instance.
Name
installed
Type
int
Has Getter
true
Has Setter
false
Description
Gets the number of installed modules of this type.
Name
enabled
Type
boolean
Has Getter
true
Has Setter
false
Description
Gets if this module is currently enabled in the Module Tweaker.