Dependency Overrides
WARNING
Dependency overrides are used to give modpack developers control over their mods. This should not be used by regular players.
It is recommended to understand how mod dependency fields are structured before continuing.
When developing a modpack, it is possible to find mods with dependency requirements that do not match what the mod actually requires. A common case of this is mods with too strict of a Minecraft dependency, causing them to unnecessarily break when the game recieves a minor hotfix like 26.1.1.
To solve this, Fabric Loader allows overriding a mod's dependency requirement so that the mod can attempt to load on a version of Minecraft that it is not designed for. This is meant to be a temporary solution if possible. If the mod is actively maintained, it's recommended to report this incompatibility on its issue tracker so that users do not need to use this workaround.
Setup
INFO
For the purposes of this example, we'll be using the following fabric.mod.json for a mod with the id example-mod. At any point, you can switch tabs in a code block to see how the dependency override affects this fabric.mod.json.
fabric.mod.json
json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
First, create a file named fabric_loader_dependencies.json inside the .minecraft/config folder.
Next, we fill in the file with the following boilerplate content:
json
{
"version": 1,
"overrides": {
"example-mod": {}
}
}1
2
3
4
5
6
2
3
4
5
6
json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Let's go over it line-by-line.
First, we have version, which specifies the dependency override spec version we would like to use. At the time of writing this page, the latest version is version 1.
Secondly, we have an overrides object that will contain all of our dependency overrides to various mods. To start, it includes an empty entry for example-mod that we can add dependency overrides to.
Keys inside the mod object can be one of the 5 dependency types (depends, recommends, suggests, conflicts, breaks). The value of any one of those keys must be a JSON object. This JSON object follows the exact same structure as a fabric.mod.json dependency object.
The key may be optionally prefixed with + or - (e.g. "+depends", "-breaks").
If the key is prefixed with +, the entries inside that JSON object will be added (or overridden if already exist) to the mod.
json
{
"version": 1,
"overrides": {
"example-mod": {
"+depends": {
"minecraft": ""
}
}
}
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Overriding Dependencies
Let's assume that a mod with ID example-mod depends on Minecraft version 26.1 exactly, but we want it to work on other 26.1 versions. Let's see how we can do that:
json
{
"version": 1,
"overrides": {
"example-mod": {
"depends": {
"minecraft": "26.1.x"
}
}
}
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1.x"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
A "minecraft" dependency will now be overridden if specified (and we know it is). There is another way to do this:
json
{
"version": 1,
"overrides": {
"example-mod": {
"-depends": {
"minecraft": "IGNORED"
}
}
}
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1.x"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
As specified above, the value of key "minecraft" will be ignored when removing dependencies. If a dependency with a mod ID requirement of minecraft is found, it will be removed from our target mod example-mod.
We can also override the entire depends block, but with great power comes great responsibility. Be careful.
Aside from changing the minecraft dependency, we also want to remove all suggests dependencies. We can do that by removing the prefix on the suggests key, which replaces it with an empty object, essentially clearing it. This would look like this:
json
{
"version": 1,
"overrides": {
"example-mod": {
"-depends": {
"minecraft": ""
},
"suggests": {}
}
}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {}
}1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11




