Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision |
format:modjson [2019/04/07 12:13] – asie | format:modjson [2019/05/19 21:46] – [fabric.mod.json format] falseresync |
---|
====== fabric.mod.json format ====== | ====== fabric.mod.json ====== |
| |
In all cases, the mod JSON, ''fabric.mod.json'', is defined as either: | In all cases, the mod JSON, ''fabric.mod.json'', is defined as either: |
===== Version 1 (current) ===== | ===== Version 1 (current) ===== |
| |
//TODO: Work in progress!// | **Pertains to Loader 0.4.0 and above.** |
| |
==== Types ==== | ==== Types ==== |
An EntrypointContainer is an object. | An EntrypointContainer is an object. |
| |
The keys match the getEntrypoints() "type" field, and are the type of the entrypoints to be listed - "main", "client", "server". The values of those keys are arrays, containing objects of the following form: | The keys match the getEntrypoints() "type" field, and are the type of the entrypoints to be listed - "main", "client", "server". The values of those keys are arrays, containing either strings (of the object key "value"'s value) or objects of the following form: |
| |
* "adapter": Optional key denoting the language adapter to use. If empty, assume "default". | * "adapter": Optional key denoting the language adapter to use. If empty, assume "default". |
* "value": The default language adapter uses this specific key as a string value of any of the following formats: | * "value": The default language adapter uses this specific key as a string value of any of the following formats: |
* "my/package/MyClass", which points to a class to be instantiated, | * "my.package.MyClass", which points to a class to be instantiated, |
* "my/package/MyClass::thing", which points to a static field (contents returned) or method handle (for interface types, proxied automatically) named "thing". | * "my.package.MyClass::thing", which points to a static field (contents returned) or method handle (for interface types, proxied automatically) named "thing". |
| |
Fabric, by default, will run all "main" entrypoints (type ModInitializer), and all "client" (type ClientModInitializer) or "server" (type DedicatedServerModInitializer) entrypoints after that. | Fabric, by default, will run all "main" entrypoints (type ModInitializer), and all "client" (type ClientModInitializer) or "server" (type DedicatedServerModInitializer) entrypoints after that. |
* 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. | * 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 [[https://spdx.org/licenses/|SPDX License Identifiers]] for "open source" licenses. | * To aid automated tools, it is recommended to use [[https://spdx.org/licenses/|SPDX License Identifiers]] for "open source" licenses. |
* **icon**: Contains the mod's icon, as a square .PNG file. Can be provided in one of two forms: | * **icon**: Contains the mod's icon, as a square .PNG file. (Minecraft resource packs use 128x128, but that is not a hard requirement - a power of two is, however, recommended.) Can be provided in one of two forms: |
* A string, providing the path (from the mod's root) to a single .PNG file, | * A string, providing the path (from the mod's root) to a single .PNG file, |
* A string->string dictionary, where the keys conform to widths of each PNG file, and the values are said files' paths. | * A string->string dictionary, where the keys conform to widths of each PNG file, and the values are said files' paths. |