Skip to content

JSON Patches

Petr Mrázek edited this page Dec 11, 2018 · 9 revisions

Patches

Patches are stored in <instance>/patches/<name>.json, where <name> should be a Java package-style descriptor, for example net.minecraftforge or com.mumfrey.liteloader.

Format

The format of patches are similar to that of the vanilla version.json, but with some additions.

Lets start with the LiteLoader patch as an example:

{
  "+tweakers": [
    "com.mumfrey.liteloader.launch.LiteLoaderTweaker"
  ],
  "formatVersion": 1,
  "libraries": [
    {
      "name": "net.minecraft:launchwrapper:1.9"
    },
    {
      "name": "org.ow2.asm:asm-all:4.1"
    },
    {
      "name": "com.mumfrey:liteloader:1.7.2_05",
      "url": "http://dl.liteloader.com/versions/"
    }
  ],
  "mainClass": "net.minecraft.launchwrapper.Launch",
  "name": "LiteLoader",
  "order": 10,
  "releaseTime": "2014-07-14T20:23:26",
  "requires": [
    {
      "equals": "1.7.2",
      "uid": "net.minecraft"
    }
  ],
  "type": "release",
  "uid": "com.mumfrey.liteloader",
  "version": "1.7.2_05"
}

Package metadata fields

These fields describe the package and its dependencies.

Field Description
uid Should be the same as the <name> of the file.
name A human-readable name of the software this describes.
version The version of this patch, or the the library it is for
requires List of dependencies of this patch. In this case, it depends on version 1.7.2 of Minecraft.
order DEPRECATED: Used to help sorting patches, lower number means applied earlier.
type Type of the package release (release, snapshot, etc.)
releaseTime Package release timestamp (ISO format). Used for sorting versions in lists.

Game metadata fields

These fields actually affect the launching of the game. Some can be added to or removed from using + or - before the field name, while others can only be overwritten. No + or - means overwrite.

Field Description
mainClass This is the name of the Java class that will be used for starting the game.
+tweakers WITH LAUNCHWRAPPER ONLY: A list of tweakers passed to Minecraft with --tweakClass
libraries A list of libraries (artifacts) used by the game. See below for more info

libraries

The libraries list contains a list of objects with the following possible fields.

name is the only field that is required

name

The 'augmented maven coordinate' of the library.

The format is <group>:<name>:<version>[:classifier][@extension]. The classifier and extension parts are optional, classifier is nothing by default and extension is jar by default.

For global libraries (without local hint), the format translates to path:

libraries/<group with dots replaced by />/<name>/<version>/<name>-<version>[-<classifier>].<extenstion>

For example com.mumfrey:liteloader:1.7.2_04 means:

libraries/com/mumfrey/liteloader/1.7.2_04/liteloader-1.7.2_04.jar

com.mumfrey:liteloader:1.7.2_04:foo@zip means:

libraries/com/mumfrey/liteloader/1.7.2_04/liteloader-1.7.2_04-foo.zip

Local libraries reside inside instances and the name translates to:

$instance/libraries/<name>-<version>[-<classifier>].<extenstion>

url

A base URL for downloading the library.

natives

The natives key provides a string for each specific platform to be used as the classifier. This allows having different versions of a library on different operating systems.

rules

The rules key is used to determine if the library is to be used at all or not.

MMC-absoluteUrl

This specifies the exact URL to download the library from.

MMC-hint

This can have three different values:

  • local - MultiMC will load the library from inside the instance ($Instance/libraries/$library.jar) and will not try to download it.
  • always-stale - MultiMC will always try to download a new version of the library.
  • forge-pack-xz - the downloaded file should be post-processed using forge-specific rules.

Additional information

Also see here for some more information on the vanilla format (not used here, but closely related).

There used to be a file called custom.json that would completely override the content in a version.json. This made it hard to add/remove things like Forge and LiteLoader. The patches were originally created to solve the problem of overlaying things like Forge on top of the Mojang game version. Later, this system was further extended to what it is now -- to support dependencies and automatic dependency resolving/checking.

Clone this wiki locally