Mod Loaded (Meta Condition Type)
Checks whether another mod is installed, optionally at a given version. It ignores its context entirely, so the same type works wherever a condition does (entity, bi-entity, item, block, damage, fluid and biome) and in a power's load_condition.
Type ID: apoli:mod_loaded
Fields
| Field | Type | Default | Description |
|---|---|---|---|
mod | String | optional | A mod ID that must be installed. |
mods | list of String | [] | Mod IDs that must all be installed. |
version | String | optional | When set, every named mod's version must also satisfy comparison against this. |
comparison | Comparison | >= | How each mod's version is compared with version. |
At least one of mod and mods must be given, and with neither the condition never passes. Give both and every ID in both has to match.
Versions are compared one group of numbers at a time, so 1.9 is older than 1.10, and a release is newer than its own pre-releases (4.2.0 beats 4.2.0-beta.1). Anything after a + is build metadata and is ignored, so 4.7.6+Fabric compares as 4.7.6.
Whether a mod is installed never changes while the game runs, so this is worked out once, when the JSON is read. Testing it every tick costs nothing.
Examples
"condition": {
"type": "apoli:mod_loaded",
"mod": "icarus"
}This passes while Icarus is installed.
"condition": {
"type": "apoli:mod_loaded",
"mods": ["pehkui", "trinkets"],
"inverted": true
}This passes unless both Pehkui and Trinkets are installed.
"load_condition": {
"type": "apoli:mod_loaded",
"mod": "icarus",
"version": "4.0.0"
}As a load_condition on a power, the power is only read at all when Icarus 4.0.0 or newer is installed. That is the only way to use a power type that doesn't exist without its mod. apoli:wings is only registered when Icarus is, so a plain condition can't save a power that names it.