Skip to content
Open
Show file tree
Hide file tree
Changes from 23 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
14 changes: 14 additions & 0 deletions .vitepress/sidebars/develop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,20 @@ 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.porting",
collapsed: true,
Expand Down
4 changes: 4 additions & 0 deletions .vitepress/sidebars/players.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ export default [
text: "players.troubleshooting.crash_reports",
link: "/players/troubleshooting/crash-reports",
},
{
text: "players.troubleshooting.dependency_overrides",
link: "/players/troubleshooting/dependency-overrides",
},
],
},
{
Expand Down
1 change: 1 addition & 0 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
code,
pre {
tab-size: 2 !important;
font-variant-ligatures: none;
}

/* Sidebar Scrollbar - Styles scrollbars within the side navigation pane for improved visibility. */
Expand Down
15 changes: 2 additions & 13 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 @@ -23,17 +20,9 @@ The most important fields in the `fabric.mod.json` file are:
- `depends`: The mods that your mod depends on.
- `mixins`: The mixins that your mod provides.

You can see an example `fabric.mod.json` file below - this is the `fabric.mod.json` file for the mod that powers this documentation site.

::: details `fabric.mod.json` of the Example Mod

@[code lang=json](@/reference/latest/src/main/resources/fabric.mod.json)

:::

## 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
283 changes: 283 additions & 0 deletions develop/loader/fabric-mod-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,283 @@
---
title: fabric.mod.json
description: A guide to the `fabric.mod.json` specification.
authors:
- cassiancc
- falseresync
- jamieswhiteshirt
- IMB11
- SolidBlock-cn
authors-nogithub:
- skyland1a
resources:
https://github.com/FabricMC/fabric-loom/blob/dev/1.16/src/main/java/net/fabricmc/loom/api/fmj/FabricModJsonV1Spec.java: Source Code for fabric.mod.json v1 Spec
https://github.com/FabricMC/fabric-language-kotlin: Fabric Language Kotlin's Language Provider
https://spdx.org/licenses/: SPDX License Identifiers
https://semver.org/: Semantic Versioning
https://jubianchi.github.io/semver-check/: Semantic Version Comparison Tool
---

<!-- markdownlint-configure-file { MD033: { allowed_elements: [script, Range] } } -->

<script setup lang="ts">
import { h } from "vue";

const Range = ({ r }) => h(
"a",
{
href: `https://jubianchi.github.io/semver-check/#/${encodeURIComponent(r)}/26.1.2`,
Comment thread
cassiancc marked this conversation as resolved.
Outdated
target: "_blank",
rel: "noreferrer",
},
h("code", r)
);
</script>

The `fabric.mod.json` file is a metadata file used by Fabric Loader to load mods. It must be placed in the JAR's root directory for the mod to get loaded.

A predefined `fabric.mod.json` file is included in the template mod, or it can be [generated by Fabric Loom](../loom/tasks#fabric-mod-json).

You can consult the [source code of the specification for `fabric.mod.json` v1](https://github.com/FabricMC/fabric-loom/blob/-/src/main/java/net/fabricmc/loom/api/fmj/FabricModJsonV1Spec.java). You will also find the `fabric.mod.json` file used by this website's Example Mod below.

::: details `fabric.mod.json` of the Example Mod

<<< @/reference/latest/src/main/resources/fabric.mod.json

:::

## Mandatory Fields {#mandatory-fields}

The following fields are mandatory for Fabric to load your mod.

- **`schemaVersion`** Must be the first entry, and the value must always be `1`. Required for Fabric Loader to parse the file correctly.
- **`id`** A string value that defines the mod's identifier. Must start with a letter. May only contain ASCII letters, digits, underscores, or hyphens. 2 to 64 characters.
- **`version`** A string value that defines the mod's version, expected to match the [Semantic Versioning 2.0.0](https://semver.org/) specification.

```json
"schemaVersion": 1,
"id": "example-mod",
"version": "1.0.0"
```

## Mod Loading {#mod-loading}

### Environment {#environment}

- **`environment`**: A string value that defines which environments the mod should be run on:
- **`*`**: Runs in all environments. Default.
- **`client`**: Runs on the physical client side. If set, your mod will not be loaded on dedicated servers.
- **`server`**: Runs on the physical server side. If set, your mod will not be loaded on clients, this includes singleplayer and LAN.

```json
"environment": "*"
```
Comment thread
cassiancc marked this conversation as resolved.

### Entrypoints {#entrypoints}

- **`entrypoints`** An object that defines the main classes that your mod will load.
- **`main`** An array of string class names that implement `ModInitializer`.
- **`client`** An array of string class names that implement `ClientModInitializer`. This entrypoint is run after `main`, and only on the physical client side.
- **`server`** An array of string class names that implement `DedicatedServerModInitializer`. This entrypoint is run after `main`, and only on the physical server side.

Fabric Loader provides those three main entrypoints, but other mods may provide their own. For example, Fabric API provides `fabric-datagen` for data generator entrypoints.

Each entrypoint can load multiple classes, and even methods or static fields. For example:

```json
"main": [
"net.fabricmc.example.ExampleMod",
"net.fabricmc.example.ExampleMod::handle"
Comment thread
cassiancc marked this conversation as resolved.
]
```

::: tip

If you're not using Java, you should consult the language adapter's documentation. For Kotlin, that's in the [Fabric Language Kotlin's README](https://github.com/FabricMC/fabric-language-kotlin/blob/master/README.md).

:::

### JARs {#jars}

- **`jars`**: An array of JARs to be nested inside your mod. When using `include` on your dependencies, Loom will automatically populate this. Each entry is an object containing a `file` key, with a path to the nested JAR from within your mod's. For example:

```json
"jars": [
{
"file": "nested/vendor/dependency.jar"
}
]
```

### Language Adapters {#language-adapters}

- **`languageAdapters`**: A dictionary of classes that implement `LanguageAdapter`.

```json
"languageAdapters": {
"kotlin": "net.fabricmc.language.kotlin.KotlinAdapter"
}
```

### Mixins {#mixins}

- **`mixins`**: A list of mixin configuration files. Each entry is either a path to a mixin configuration file within your mod's JAR, or an object containing the following fields:
- **`config`**: The path to the mixin configuration file inside your mod's JAR.
- **`environment`**: Behaves just like the [upper level **environment** field](#environment). For example:

```json
"mixins": [
"example-mod.mixins.json",
{
"config": "example-mod.client-mixins.json",
"environment": "client"
}
]
```

### Access Wideners {#accesswideners}

- **`accessWidener`**: A string identifying an [access widener or class tweaker](../class-tweakers/) file.

```json
"accessWidener": "example-mod.classtweaker"
```

### Provides {#provides}

- **`provides`**: An array of mod IDs that will be aliases for the mod. Fabric Loader will treat these IDs as if the respective mods exist. If any other mod uses one of them, it will not be loaded.

```json
"provides": [
"example_mod"
]
```

## Dependency Resolution {#dependency-resolution}

The following keys will accept a dictionary of dependencies. For more details on how to structure the dictionary, see below:

- **`depends`**: For dependencies required to run. **If any are missing, Fabric Loader will trigger a crash**.
- **`recommends`**: For dependencies not required to run. For each missing dependency, Fabric Loader will log a warning.
- **`suggests`**: For dependencies not required to run. Use this as a kind of metadata.
- **`breaks`**: For mods whose together with yours might cause a game crash. **If any are present, Fabric Loader will trigger a crash**.
- **`conflicts`**: For mods whose together with yours cause some kind of bugs, etc. For each conflicting mod present, Fabric Loader will log a warning.

### Semantic Versioning {#semantic-versioning}

The key of each entry is the mod ID of the dependency.

The value of each key is a string or array of strings declaring supported version ranges of the dependency. If it's an array, only one of the ranges has to match for the constraint to be satisfied.

Here are some examples of ranges and what they indicate. Try using [jubianchi's Semver check](https://jubianchi.github.io/semver-check/#/) to test which values will satisfy the constraint.

::: details Semantic Versioning Examples

| Range | Description | Matches | Clashes |
| ----- | ----------- | ------- | ------- |
| <Range r="*" /> | Any version (not recommended) | `26.1.2`, `24w14potato`... | _none_ |
| <Range r="26.1.2" /> | Exact version only | `26.1.2` | `26.1`, `26.1.1`, `26.2`... |
| <Range r="26.1.0 \|\| 26.1.1" /> | Either range | `26.1.0`, `26.1.1` | `26.1.2`, `26.2`... |
| <Range r="[26.1.0, 26.1.1]" /> | Equivalent to `26.1.0 \|\| 26.1.1` | `26.1`, `26.1.1` | `26.1.2`, `26.2`... |
| <Range r=">26" /> | Above a version (exclusive) | `26.1.2`, `26.2`... | `26`, `25.x`... |
| <Range r=">=26.1" /> | At or above a version (inclusive) | `26.1`, `26.1.2`, `26.2`... | `26.0`, `25.x`... |
| <Range r="<=26.1" /> | At or below a version (inclusive) | `26.1`, `26.0`, `25.x`... | `26.1.2`, `26.2`... |
| <Range r=">26 <26.2" /> | Between two versions (both exclusive) | `26.1`, `26.1.2`, snapshots... | `26`, `26.2`... |
| <Range r=">=26.1 <26.2" /> | Between two versions (inclusive lower bound) | `26.1`, `26.1.2`, snapshots... | `26.0`, `26.2`... |
| <Range r="26.1.x" /> | Any patch of a minor version | `26.1`, `26.1.2`, snapshots... | `26.2`, `27.x`... |
| <Range r="~26.1" /> | Same as `26.1.x` | `26.1`, `26.1.2`, snapshots... | `26.2`, `27.x`... |
| <Range r="^26.1" /> | Any version in the same major | `26.1.2`, `26.2`, `26.3`... | `25.x`, `27.x`... |

:::

```json
"depends": {
"example-mod": "*",
"minecraft": [
"26.1",
"26.1.1"
]
}
"suggests": {
"another-mod": ">1.0.0"
Comment thread
cassiancc marked this conversation as resolved.
}
```

## Metadata {#metadata}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd move this after Mandatory Fields, before Mod Loading.


- **`name`**: A string that defines the user-friendly mod's name. If not present, assume it matches **id**.
- **`description`**: A string that defines the mod's description. If not present, assume empty string.
Comment on lines +207 to +208
Copy link
Copy Markdown
Member

@its-miroma its-miroma Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **`name`**: A string that defines the user-friendly mod's name. If not present, assume it matches **id**.
- **`description`**: A string that defines the mod's description. If not present, assume empty string.
- **`name`**: A string that defines the user-friendly mod name. If not present, defaults to the **id**.
- **`description`**: A string that defines the mod's description. If not present, defaults to an empty string.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by tagline? This isn't generally a short slogan, most descriptions are paragraphs.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mb, thought it was this thing

image

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can be - Mod Menu uses it for both the description and the summary unless the user specifies a proper summary via its translation API.
image
image


```json
"name": "Example Mod",
"description": "This is an example description! Tell everyone what your mod is about!",
```

### Contact {#contact}

**`contact`**: A dictionary that defines the contact information for the project. Some common fields include:

- **`email`**: A string that defines the contact e-mail pertaining to the mod. Must be a valid e-mail address.
- **`homepage`**: A string that defines the project or user's homepage. Must be a valid HTTP/HTTPS address.
- **`irc`**: A string that defines the IRC channel pertaining to the mod. Must be of a valid URL format - for example: `irc://irc.esper.net:6667/charset` for `#charset` at EsperNet - the port is optional, and assumed to be 6667 if not present.
- **`issues`**: A string that defines the project's issue tracker. Must be a valid HTTP/HTTPS address.
- **`sources`**: A string that defines the project's source code repository. Must be a valid URL - it can, however, be a specialized URL for a given VCS (such as Git or Mercurial).

The list is not exhaustive - mods may provide additional non-standard keys, such as **`discord`**, **`slack`**, **`twitter`**... If possible, those should be valid URLs.

```json
"contact": {
"homepage": "https://fabricmc.net",
"sources": "https://github.com/FabricMC/fabric-example-mod"
Comment on lines +229 to +230
Copy link
Copy Markdown
Member

@its-miroma its-miroma Apr 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"homepage": "https://fabricmc.net",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"homepage": "https://docs.fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-docs"

}
```

### Authors and Contributors {#authors-contributors}

- **`authors`** An array of authors of the mod. Entries can be either a string or an object with the fields listed below.
- **`contributors`** An array of contributors to the mod. Entries can be either a string or an object with the fields listed below.

Fields:

- **`name`** A mandatory string for the person's real name, or username.
- **`contact`** An optional object for the person's contact information. The same as upper level [**`contact`**](#contact).

```json
"authors": [
"Me!",
{
"name": "Tiny Potato",
"contact": {
"homepage": "https://fabricmc.net",
"sources": "https://github.com/FabricMC/fabric-example-mod"
}
}
]
```

### License {#license}

- **`license`** A string or array that defines the licensing information.

This should provide the complete set of preferred licenses conveying the entire mod package. In other words, compliance with all listed licenses should be sufficient for usage, redistribution, etc. of the mod package as a whole.

For cases where a part of code is dual-licensed, choose the preferred license. The list is not exhaustive, serves primarily as a kind of hint, and does not prevent you from granting additional rights/licenses on a case-by-case basis.

To aid automated tools, it is recommended to use [SPDX License Identifiers](https://spdx.org/licenses/) for open-source licenses.
Comment on lines +261 to +265
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This should provide the complete set of preferred licenses conveying the entire mod package. In other words, compliance with all listed licenses should be sufficient for usage, redistribution, etc. of the mod package as a whole.
For cases where a part of code is dual-licensed, choose the preferred license. The list is not exhaustive, serves primarily as a kind of hint, and does not prevent you from granting additional rights/licenses on a case-by-case basis.
To aid automated tools, it is recommended to use [SPDX License Identifiers](https://spdx.org/licenses/) for open-source licenses.
To aid automated tools, it is recommended to use [SPDX License Identifiers](https://spdx.org/licenses/) for open-source licenses.
::: info
This should provide the minimal set of licenses that satisfy the entire mod package. In other words, someone seeking to use or redistribute your mod should only need to comply with the licenses listed here.
If parts of your code are dual-licensed, choose the preferred license.
This list does not necessarily forbid you from granting additional rights or applying different licenses for certain people on a case-by-case basis.
:::

I added the info container to break up the long text—feel free to ignore


```json
"license": "CC0-1.0"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"license": "CC0-1.0"
"license": "CC-BY-NC-SA-4.0"

this is the Example Mod's current license. I reiterate: CC is horrible for code though.

```

### Icon {#icon}

- **`icon`** A string or dictionary that defines the mod's icon. Icons are square PNG files. Minecraft resource packs use 128×128, but that is not a hard requirement - a power of two is, however, recommended. Can be provided in one of two forms:
- A path to a single PNG file.
- A dictionary of images widths to their files' paths.

```json
"icon": "assets/example-mod/icon.png"
```

Comment thread
cassiancc marked this conversation as resolved.
## Custom Fields {#custom-fields}

You can add any field you want to add inside `custom` field. Loader would ignore them. However, it's highly recommended to namespace your fields to avoid conflicts with other mods.
Loading
Loading