Mod Loaded (Meta Condition Type)
Checks whether another mod is installed, optionally at a given version.
Checks whether another mod is installed, optionally at a given version. It ignores its context entirely, so the same type is available wherever a condition is — 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 | If set, every named mod’s version must also satisfy comparison against this. |
comparison | Comparison | >= | How each mod’s version is compared to version. |
At least one of mod / mods must be given; with neither, the condition is never fulfilled. Give both and every id in both has to match.
Versions are compared number-group by number-group, 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.
A mod’s presence never changes while the game runs, so this is resolved once, when the JSON is read. Testing it per tick costs nothing.
Examples
"condition": {
"type": "apoli:mod_loaded",
"mod": "icarus"
} Fulfilled while Icarus is installed.
"condition": {
"type": "apoli:mod_loaded",
"mods": ["pehkui", "trinkets"],
"inverted": true
} Fulfilled 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 does not exist without its mod — apoli:wings is registered only when Icarus is, so a plain condition cannot save a power that names it.