Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Metadata

Janrupf edited this page Jun 14, 2020 · 3 revisions

Adding Metadata

Options listed on this page apply to all download types and thus can be used in any ModDirector configuration file.

Metadata is contained in the metadata key:

{
    "url": "https://my-mod.com/download/mod.jar",
    "metadata": {
        "key1": "value",
        "key2": []
    }
}

Hashing

Often you want to validate, that the file you downloaded is the file you expect. You may do so using the hash key on a metadata object:

{
    "url": "https://my-mod.com/download/mod.jar",
    "metadata": {
        "hash": {
            "SHA-256": "fb7b04aeb26dfa82eb28807f282e7acd130630358e44d6cee189f313e02b5cb9",
            "MD5": "bcb6544158730c8fbb133affe2fbce1b"
        }
    }
}

Note that not all hashes are checked. Ideally, you should provide two to three hashes, the first one being the strongest, the last one being the weakest, but also most commonly supported one. This is done in order to support Java implementations, which don't provide all hash variants. ModDirector will always use the first supported one and check against it. The first supported one is used entirely to determine if the file is ok, so once one has failed, no other are being checked. If no supported one is found, ModDirector assumes the hashes match.

A good combination of hashes should always be SHA-256 and MD5. Feel free to add others if you need to, but note that as stated above not all Java implementations might support them.

This feature is supported in version 1.2+

Side config

Sometimes you just want a mod to be either loaded on the server or the client. To do so, a side value can be specified in the metadata.

{
    "url": "https://my-mod.com/download/mod.jar",
    "metadata": {
        "side": "CLIENT"
    }
}

side can be CLIENT or SERVER. BOTH has been omitted, if you want the mod to load everywhere, just omit the side metadata field.

This feature is supported in version 1.4+

Clone this wiki locally