Skip to content

Mod Loading order

Two Phases

117 & 1800

Mods are loaded depending on their ModInfo in two phases.

graph LR
  A[Normal Phase] --> C;
  C[Late Phase];

Load After Dependency

117 & 1800

Within a phase mods are ordered by their LoadAfter entry.

Mods specified in LoadAfter in modinfo.json are loaded before. Circular dependencies result in undefined order.

No warning is printed if the mentioned mod is not available.

Use Dependencies.Require 117 or ModDependencies 1800 to mark a mod as required.

modinfo.json
{
  "ModID": "mod-c",
  "Dependencies": {
    "LoadAfter": [
      "mod-a",
      "mod-b"
    ]
  }
}
modinfo.json
{
  "ModID": "mod-c",
  "LoadAfterIds": [
    "mod-a",
    "mod-b"
  ]
}
Do not rely on alphabetical loading behavior.

In order to keep some compatibilty with mods created before the introduction of mod dependencies, mods without dependency information are loaded alphabetically.

But this is unpredictable, because as soon as another mod depends on it, it will not be alphabetical anymore.

Late Phase

117 & 1800

Only late phase mods can depend on other late phase mods.

A mod without a * cannot load after a mod with a *.

{
  "ModID": "post-b",
  "Dependencies": {
    "LoadAfterIds": [
      "*",
      "post-a"
    ]
  }
}
{
  "ModID": "post-b",
  "LoadAfterIds": [
    "*",
    "post-a"
  ]
}