ModContainerHelper
com.jsmacrosce.jsmacros.api.helper.ModContainerHelper
A loaded mod's metadata exposed to scripts. Obtain wrappers from getMod() for a single mod, or from getLoadedMods().
Values come from loader metadata; use getId() to identify a mod rather than its display name. Loader differences include getAuthors() returning null and getEnv() returning "UNKNOWN".
js
// List loaded mods and their ids and versions
const mods = Client.getLoadedMods();
let i = 0;
while (i !== mods.size()) {
Chat.log(`${mods.get(i).getId()} ${mods.get(i).getVersion()}`);
i += 1;
}
// Look up a mod by id
const sodium = Client.getMod("sodium");
if (sodium !== null) {
Chat.log(sodium.getName());
}Type Parameters
T: the loader-specific mod container wrapped by this helper
Methods
getAuthors
getDependencies
getDescription
getEnv
getId
getName
getVersion
toString
Returns a diagnostic label containing the values from getId(), getName(), and getVersion() at call time. The values are inserted with
%s formatting and are not JSON-escaped.Returns: a label with the mod id, name, and version