Skip to content

Instantly share code, notes, and snippets.

@TehNut
Last active December 30, 2018 07:59
Show Gist options
  • Save TehNut/340f62d4167b225cb6d3f54119fff5a0 to your computer and use it in GitHub Desktop.
Save TehNut/340f62d4167b225cb6d3f54119fff5a0 to your computer and use it in GitHub Desktop.

Fabric Mod JSON Format

Structure

If a field declares a non-standard Type, see the Types section for additional details.

Table of Contents

Required Fields

id

The modid. This field accepts a String.

A modid must be lowercase, contain no special characters, and be less than 64 characters. IDs are check against this regex:

[a-z][a-z0-9-_]{0,63}.

{
  "id": "modid"
}

version

The current release version. This field accepts a String.

{
  "version": "1.0.0"
}

Optional Fields (Environment)

requires

A list of all required dependencies. This field accepts a DependencyMap.

{
  "requires": {
    "fabric": "*"
  }
}

conflicts

A list of dependencies that conflict with this mod. This field accepts a DependencyMap.

{
  "conflicts": {
    "fabric": {
      "version": "*",
      "side": "universal"
    }
  }
}

languageAdapter

The fully qualified class name of the language adapter that should be used when working with this mod. This field accepts a String

{
  "languageAdapter": "net.fabricmc.loader.language.JavaLanguageAdapter",
}

mixins

The Mixin files to load for the different environment types. Acceptable keys are client, common, and server.

{
  "mixins": {
    "client": "modid.client.json",
    "common": "modid.common.json",
    "server": "modid.server.json"
  }
}

side

The side on which this mod should be loaded. Acceptable values are client, server, and universal.

{
  "side": "universal"
}

lazilyLoaded

Whether or not this mod is lazily loaded. This feature is currently unimplemented. This field accepts a boolean.

{
  "lazilyLoaded": false
}

initializer

The fully qualified class name of a ModInitializer, DedicatedServerModInitializer, or ClientModInitializer. This field accepts a String.

Note: This field cannot coexist with the initializers field.

{
  "initializer": "net.fabricmc.example.ExampleMod",
}

initializers

A list of fully qualified class names of a ModInitializer, DedicatedServerModInitializer, or ClientModInitializer. This field accepts a String[].

Note: This field cannot coexist with the initializer field.

{
  "initializers": [
    "net.fabricmc.example.ExampleMod",
    "net.fabricmc.example.ExampleModClient",
    "net.fabricmc.example.ExampleModServer"
  ]
}

Optional Fields (Metadata)

name

The display name. This field accepts a String.

{
  "name": "Example Mod",
}

description

A short description of what this mod does. This field accepts a String.

{
  "description": "This is an example description! Tell everyone what your mod is about!",
}

links

Links relevant to this mod. This field accepts a Links.

{
  "links": "https://website.com"
}

recommends

A list of dependencies recommended for use with this mod. This field accepts a DependencyMap.

{
  "requires": {
    "fabric": [
      "1.0.0",
      "1.0.1"
    ]
  }
}

authors

A list of people who author this project. This field accepts a Person[].

{
  "authors": [
    "John Doe <jdoe@website.com> (https://website.com)"
  ]
}

contributors

A list of people who have contributed to this project. This field accepts a Person[].

{
  "authors": [
    "Jane Doe"
  ]
}

license

The license this project falls under. This field accepts a String.

{
  "license": "WTFPL"
}

Type

DependencyMap

A DependencyMap can be one of the following formats:

Map<String, String>

{
  "requires": {
    "fabric": "*"
  }
}

Map<String, String[]>

{
  "requires": {
    "fabric": [
      "1.0.0",
      "1.0.1"
    ]
  }
}

Map<String, Dependency>

A Dependency consists of two fields:

  • version
  • side
{
  "requires": {
    "fabric": {
      "version": "*",
      "side": "universal"
    }
  }
}

Links

A Links can be one of the following formats:

String

{
  "links": "https://website.com"
}

Map<String, String>

Acceptable keys are homepage, issues, and sources. All are optional.

{
  "links": {
    "homepage": "https://website.com",
    "issues": "https://website.com/issues",
    "sources": "https://website.com/sources"
  }
}

Person

A Person can be one of the following formats:

String

Note: Both the email and website are optional.

{
  "authors": [
    "John Doe <jdoe@website.com> (https://website.com)"
  ]
}

Object

Note: Both the email and website are optional.

{
  "authors": [
    {
      "name": "John Doe",
      "email": "jdoe@website.com",
      "website": "https://website.com"
    }
  ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment