User Tools

Site Tools


format:modjson

This is an old revision of the document!


fabric.mod.json format

In all cases, the mod JSON, fabric.mod.json, is defined as either:

  • an object containing a “schemaVersion” key with an integer value, denoting the version of the format,
  • or an array containing such objects (this is not supported by Loader as of 0.4.0, but is a part of the specification).

If a “schemaVersion” key is missing, assume version “0”.

It is important to remember that the Fabric mod JSON is authoritative. This means that Loader relies on it specifically to gather the necessary information - from the perspective of an external tool, its contents can be trusted and relied upon.

Version 1 (current)

TODO: Work in progress!

Types

Person

A string in one of the following formats:

  • name
  • name <email>
  • name (url)
  • name <email> (url)

The fields are as follows:

  • name - The person's real name or username,
  • email - The person's e-mail address,
  • url - Any valid URL. This will usually be the person's personal homepage, or another such relevant website.

Mandatory fields

  • id: Contains the mod identifier - a string value matching the ^[a-z][a-z0-9-_]{1,63}$ pattern.
  • version: Contains the mod version - a string value, optionally matching the Semantic Versioning 2.0.0 specification.

Optional fields (mod loading)

  • envType: For games with multiple environments - is a string value or an array of string values providing types the mod should be considered to load on. Supported values are:
    • “”, “*” - all environments (default),
    • “client” - the game client,
    • “server” - the game dedicated server (integrated servers are not included here).
  • initializers: Contains a list of “initializer” classes - an array of strings in package.subpackage.class format. If not present, assume empty array.
  • mixins: Contains a list of mixin configuration files for the Mixin library as filenames relative to the mod root - an array of (can be mixed):
    • string values,
    • objects containing a “config” key (filename), as well as optional keys of the following types: “envType”

Optional fields (metadata)

  • name: Contains the user-facing mod name - a string value. If not present, assume it matches id.
  • description: Contains the user-facing mod description - a string value. If not present, assume empty string.
  • authors: Contains the direct authorship information - an array of Person values.
  • contributors: Contains the contributor information - an array of Person values.
  • contact: Contains contact information relevant to the mod of question. It is stored as a string→string dictionary.
    • The following keys are officially defined, and have an enforced format:
      • email: Contact e-mail pertaining to the mod. Must be a valid e-mail address.
      • irc: IRC channel pertaining to the mod. Must be of the format #channel@server or #channel@server:port. TODO: we should probably use an URL here, to be consistent: irc://server:port/channel?
      • homepage: Mod homepage. Must be a valid HTTP/HTTPS address.
      • issues: Mod issue tracker. Must be a valid HTTP/HTTPS address.
      • sources: Mod 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) - if possible, they should be valid URLs.
  • license: Contains the licensing information - a string value, or an array of string values.
    • 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 for “open source” licenses.

Version 0

This version is utilized if the “schemaVersion” field is missing - where it is assumed to be 0. It was used by all Fabric Loader versions prior to 0.4.0. It was inspired by the craftson/spec specification.

TODO: Document me!

format/modjson.1550622842.txt.gz · Last modified: 2019/02/20 00:34 by asie