fabric.mod.json 26.1.2
A guide to the fabric.mod.json specification.
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.
You can consult the source code of the specification for fabric.mod.json v1. You will also find the fabric.mod.json file used by this website's Example Mod below.
fabric.mod.json of the Example Mod
json
{
"schemaVersion": 1,
"id": "example-mod",
"version": "1.0.0",
"name": "Example Mod",
"icon": "assets/example-mod/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"com.example.docs.ExampleMod",
"com.example.docs.event.ExampleModEvents",
"com.example.docs.command.ExampleModCommands",
"com.example.docs.effect.ExampleModEffects",
"com.example.docs.potion.ExampleModPotions",
"com.example.docs.sound.ExampleModSounds",
"com.example.docs.damage.ExampleModDamageTypes",
"com.example.docs.item.ExampleModItems",
"com.example.docs.enchantment.ExampleModEnchantments",
"com.example.docs.block.ExampleModBlocks",
"com.example.docs.block.entity.ExampleModBlockEntities",
"com.example.docs.menu.ExampleModMenuType",
"com.example.docs.component.ExampleModComponents",
"com.example.docs.advancement.ExampleModDatagenAdvancement",
"com.example.docs.networking.ExampleModNetworking",
"com.example.docs.networking.basic.ExampleModNetworkingBasic",
"com.example.docs.debug.ExampleModDebug",
"com.example.docs.saveddata.ExampleModSavedData",
"com.example.docs.entity.attribute.ExampleModAttributes",
"com.example.docs.recipe.ExampleModRecipes",
"com.example.docs.entity.ExampleModEntity",
"com.example.docs.gamerule.ExampleModGameRules"
],
"client": [
"com.example.docs.client.command.ExampleModClientCommands",
"com.example.docs.ExampleModBlockEntityRenderer",
"com.example.docs.ExampleModDynamicSound",
"com.example.docs.ExampleModClient",
"com.example.docs.ExampleModScreens",
"com.example.docs.rendering.CustomRenderPipeline",
"com.example.docs.rendering.HudRenderingEntrypoint",
"com.example.docs.rendering.RenderingConceptsEntrypoint",
"com.example.docs.network.basic.ExampleModNetworkingBasicClient",
"com.example.docs.appearance.ExampleModAppearanceClient",
"com.example.docs.keymapping.ExampleModKeyMappingsClient",
"com.example.docs.ExampleModRecipesClient",
"com.example.docs.entity.ExampleModCustomEntityClient"
],
"fabric-datagen": ["com.example.docs.datagen.ExampleModDataGenerator"]
},
"mixins": [
"example-mod.mixins.json",
{
"config": "example-mod.client.mixins.json",
"environment": "client"
}
],
"depends": {
"fabricloader": ">=0.19.0",
"minecraft": "~26.1",
"java": ">=25",
"fabric-api": "*"
},
"accessWidener": "example-mod.classtweaker"
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Mandatory Fields
The following fields are mandatory for Fabric to load your mod.
schemaVersionMust be the first entry, and the value must always be1. Required for Fabric Loader to parse the file correctly.idA 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.versionA string value that defines the mod's version, expected to match the Semantic Versioning 2.0.0 specification.
json
"schemaVersion": 1,
"id": "example-mod",
"version": "1.0.0"1
2
3
2
3
Metadata
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.
json
"name": "Example Mod",
"description": "This is an example description! Tell everyone what your mod is about!",1
2
2
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/charsetfor#charsetat 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"
}1
2
3
4
2
3
4
Authors and Contributors
authorsAn array of authors of the mod. Entries can be either a string or an object with the fields listed below.contributorsAn array of contributors to the mod. Entries can be either a string or an object with the fields listed below.
Fields:
nameA mandatory string for the person's real name, or username.contactAn optional object for the person's contact information. The same as upper levelcontact.
json
"authors": [
"Me!",
{
"name": "Tiny Potato",
"contact": {
"homepage": "https://fabricmc.net",
"sources": "https://github.com/FabricMC/fabric-example-mod"
}
}
]1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
License
licenseA string or array that defines the licensing information. To aid automated tools, it is recommended to use SPDX License Identifiers for open-source licenses.
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.
json
"license": "CC0-1.0"1
Icon
iconA 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"1
Mod Loading
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": "*"1
Entrypoints
entrypointsAn object that defines the main classes that your mod will load.mainAn array of string class names that implementModInitializer.clientAn array of string class names that implementClientModInitializer. This entrypoint is run aftermain, and only on the physical client side.serverAn array of string class names that implementDedicatedServerModInitializer. This entrypoint is run aftermain, 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"
]1
2
3
4
2
3
4
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.
JARs
jars: An array of JARs to be nested inside your mod. When usingincludeon your dependencies, Loom will automatically populate this. Each entry is an object containing afilekey, with a path to the nested JAR from within your mod's. For example:
json
"jars": [
{
"file": "nested/vendor/dependency.jar"
}
]1
2
3
4
5
2
3
4
5
Language Adapters
languageAdapters: A dictionary of classes that implementLanguageAdapter.
json
"languageAdapters": {
"kotlin": "net.fabricmc.language.kotlin.KotlinAdapter"
}1
2
3
2
3
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. For example:
json
"mixins": [
"example-mod.mixins.json",
{
"config": "example-mod.client-mixins.json",
"environment": "client"
}
]1
2
3
4
5
6
7
2
3
4
5
6
7
Access Wideners
accessWidener: A string identifying an access widener or class tweaker file.
json
"accessWidener": "example-mod.classtweaker"1
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"
]1
2
3
2
3
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
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 to test which values will satisfy the constraint.
Semantic Versioning Examples
Note: Minecraft does not abide by semantic versioning. If needed, Fabric will translate a Minecraft version into its equivalent in semantic versioning. Examples include 26.1->26.1.0, 26.1-snapshot-1->26.1-alpha.1, 26w14a->26.1.1-alpha.26.14.a.
| Range | Description | Matches | Clashes |
|---|---|---|---|
* | Any version (not recommended) | 26.1.2, 24w14potato... | none |
26.1.2 | Exact version only | 26.1.2 | 26.1, 26.1.1, 26.2... |
26.1.0 || 26.1.1 | Either range | 26.1.0, 26.1.1 | 26.1.2, 26.2... |
[26.1.0, 26.1.1] | Equivalent to 26.1.0 || 26.1.1 | 26.1, 26.1.1 | 26.1.2, 26.2... |
>26 | Above a version (exclusive) | 26.1.2, 26.2... | 26, 25.x... |
>=26.1 | At or above a version (inclusive) | 26.1, 26.1.2, 26.2... | 26.0, 25.x... |
<=26.1 | At or below a version (inclusive) | 26.1, 26.0, 25.x... | 26.1.2, 26.2... |
>26 <26.2 | Between two versions (both exclusive) | 26.1, 26.1.2, snapshots... | 26, 26.2... |
>=26.1 <26.2 | Between two versions (inclusive lower bound) | 26.1, 26.1.2, snapshots... | 26.0, 26.2... |
26.1.x | Any patch of a minor version | 26.1, 26.1.2, snapshots... | 26.2, 27.x... |
~26.1 | Same as 26.1.x | 26.1, 26.1.2, snapshots... | 26.2, 27.x... |
^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"
}1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
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.






