Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bd37430
Start porting `fabric.mod.json` article
cassiancc Apr 3, 2026
6d9d25e
Revise articcles
cassiancc Apr 3, 2026
f7f3d5e
Start addressing review comments
cassiancc Apr 3, 2026
dddb1b6
prettier
cassiancc Apr 3, 2026
c7e3dc9
Add dependency examples
cassiancc Apr 3, 2026
63c7b1e
Apply suggestions from code review
cassiancc Apr 4, 2026
006a09c
Further fixes
cassiancc Apr 4, 2026
52559b4
Update fabric-mod-json.md
cassiancc Apr 4, 2026
b904443
Port the dependency overrides article
cassiancc Apr 5, 2026
48c32a0
linting
cassiancc Apr 5, 2026
362200f
revise loader docs
cassiancc Apr 5, 2026
eca5e61
Interlink Loom and Loader docs
cassiancc Apr 5, 2026
0e400ce
Fix `>=`
cassiancc Apr 8, 2026
76d2f8a
Apply suggestions from code review
cassiancc Apr 9, 2026
4083a4d
Move dependency overrides to `Players/Troubleshooting`
cassiancc Apr 9, 2026
a8f6d48
Update Loader header
cassiancc Apr 9, 2026
297c8b9
Apply suggestions from code review
cassiancc Apr 9, 2026
8c52ada
Heading revisions
cassiancc Apr 9, 2026
092406a
Prettier
cassiancc Apr 9, 2026
f362e76
Move FMJ example to reference page
cassiancc Apr 19, 2026
19dc064
Apply suggestions from code review
cassiancc Apr 20, 2026
9e15cfe
Apply suggestions from code review
cassiancc Apr 20, 2026
eb52a36
Update fabric-mod-json.md
cassiancc Apr 20, 2026
92da873
prettier
cassiancc Apr 20, 2026
896fd80
Update develop/loader/fabric-mod-json.md
cassiancc Apr 20, 2026
45fa09b
Update develop/loader/fabric-mod-json.md
cassiancc Apr 20, 2026
6029ff8
quiet linter
cassiancc Apr 20, 2026
e20c2b6
Update fabric-mod-json.md
cassiancc Apr 20, 2026
0c71df5
Bump loader
cassiancc Apr 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .vitepress/sidebars/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,24 @@ export default [
},
],
},
{
text: "develop.loader",
collapsed: true,
items: [
{
text: "develop.loader.index",
link: "/develop/loader/",
},
{
text: "develop.loader.fabric.mod.json",
link: "/develop/loader/fabric-mod-json",
},
{
text: "develop.loader.dependency_overrides",
link: "/develop/loader/dependency-overrides",
},
],
},
{
text: "develop.porting",
collapsed: true,
Expand Down
7 changes: 2 additions & 5 deletions develop/getting-started/project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@ title: Project Structure
description: An overview of the structure of a Fabric mod project.
authors:
- IMB11
resources:
https://wiki.fabricmc.net/documentation:fabric_mod_json: fabric.mod.json v1 Specification - Fabric Wiki
https://github.com/FabricMC/fabric-loom/blob/dev/1.15/src/main/java/net/fabricmc/loom/api/fmj/FabricModJsonV1Spec.java: Source Code for fabric.mod.json v1 Spec
---

This page will go over the structure of a Fabric mod project, and the purpose of each file and folder in the project.

## `fabric.mod.json` {#fabric-mod-json}

The `fabric.mod.json` file is the main file that describes your mod to Fabric Loader. It contains information such as the mod's ID, version, and dependencies.
The [`fabric.mod.json`](../loader/fabric-mod-json) file is the main file that describes your mod to Fabric Loader. It contains information such as the mod's ID, version, and dependencies.

The most important fields in the `fabric.mod.json` file are:

Expand All @@ -33,7 +30,7 @@ You can see an example `fabric.mod.json` file below - this is the `fabric.mod.js

## Entrypoints {#entrypoints}

As mentioned before, the `fabric.mod.json` file contains a field called `entrypoints` - this field is used to specify the entrypoints that your mod provides.
As mentioned before, the [`fabric.mod.json`](../loader/fabric-mod-json) file contains a field called `entrypoints` - this field is used to specify the entrypoints that your mod provides.

The template mod generator creates both a `main` and `client` entrypoint by default:

Expand Down
270 changes: 270 additions & 0 deletions develop/loader/dependency-overrides.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
---
title: Dependency Overrides
description: A guide to overriding dependencies set in a mod's `fabric.mod.json`.
authors:
- cassiancc
- skycatminepokie
- ytg1234
authors-nogithub:
- kb1000
resources:
https://semver.org/: Semantic Versioning
---

<!---->

::: 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](./fabric-mod-json#semantic-versioning) 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 {#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`.

::: details `fabric.mod.json`

```json
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}
```

:::

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:

::: code-group

```json [fabric_loader_dependencies.json]
{
"version": 1,
"overrides": {
"example-mod": {} // [!code highlight]
}
}
```

```json [fabric.mod.json]
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}
```

:::

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](./fabric-mod-json#semantic-versioning).

The key may be optionally prefixed with `+` or `-` (e.g. `"+depends"`, `"-breaks"`).

::: tabs

== Prefixed with +

If the key is prefixed with `+`, the entries inside that JSON object will be added (or overridden if already exist) to the mod.

```json{5}
{
"version": 1,
"overrides": {
"example-mod": {
"+depends": {
"minecraft": ""
}
}
}
}
```

== Prefixed with -

If the key is prefixed with `-`, the value of each entry is ignored completely and Fabric Loader will remove those entries from the resulting dependency map.

```json{5}
{
"version": 1,
"overrides": {
"example-mod": {
"-depends": {
"minecraft": ""
}
}
}
}
```

== Without a Prefix

If the key isn't prefixed, the dependency object will be replaced completely. **Be careful to prefix your keys!**

```json{5}
{
"version": 1,
"overrides": {
"example-mod": {
"depends": {
"minecraft": ""
}
}
}
}
```

:::

## Overriding Dependencies {#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:

::: code-group

```json{5-6} [fabric_loader_dependencies.json]
{
"version": 1,
"overrides": {
"example-mod": {
"depends": {
"minecraft": "26.1.x"
}
}
}
}
```

```json{2,5-6} [fabric.mod.json]
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1.x"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}
```

:::

A `"minecraft"` dependency will now be overridden if specified (and we know it is). There is another way to do this:

::: code-group

```json{5-6} [fabric_loader_dependencies.json]
{
"version": 1,
"overrides": {
"example-mod": {
"-depends": {
"minecraft": "IGNORED"
}
}
}
}
```

```json{2,5-6} [fabric.mod.json]
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1.x"
},
"breaks": {
"optifabric": "*"
},
"suggests": {
"anothermod": "*",
"flamingo": "*",
"modupdater": "*"
}
}
```

:::

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:

::: code-group

```json [fabric_loader_dependencies.json]
{
"version": 1,
"overrides": {
"example-mod": {
"-depends": {
"minecraft": ""
},
"suggests": {} // [!code highlight]
}
}
}
```

```json [fabric.mod.json]
{
"depends": {
"fabricloader": ">=0.11.1",
"fabric-api": ">=0.28.0",
"minecraft": "26.1"
},
"breaks": {
"optifabric": "*"
},
"suggests": {} // [!code highlight]
}
```

:::

<!---->
Loading
Loading