Skip to content

dynamic_repo

AdamCalculator edited this page Mar 15, 2024 · 18 revisions

Dynamic repo

Dynamic repositories are repositories that require participation from their owner, but in return, when updating, only the missing files are downloaded, and not the entire package.

Configure resourcepack

.minecraft/resourcepack/MyRP.zip!/dynamicmcpack.json

{
  "current": {
    "build": 12
  },
  "remote": {
    "type": "dynamic_repo",
    "url": "https://myrp.github.io/repo"
  },
  "formatVersion": 1
}

In this example, the repository will be hosted on GitHub pages https://myrp.github.io/repo

But you can use any site, or its separate folder, for example you can use it like this: https://raw.githubusercontent.com/AdamCalculator/DynamicPack/main/

After the link there should be some mod files, and they will be accessed like this:

Let's look at the contents of the first file dynamicmcpack.repo.json

{
  "formatVersion": 1,
  "build": 12,
  "name": "MyRP",
  "contents": [
    {
      "id": "generic",
      "url": "content_generic.json"
    }
  ]
}

Important

Since the content file can become very large (you will soon find out) the "url_compressed" key is supported, it must contain a link to a gzip-compressed json file (.json.gz)

it can contain a lot of content, which can be enabled and disabled in the future in the GUI of the mod. The important stuff starts in the content file

https://myrp.github.io/repo/content_generic.json

{
  "formatVersion": 1,
  "content": {
    "parent": "",
    "files": {
      "pack.png": {
        "hash": "66a7820917394710ab341a84ea38e7f2daf8288e"
      },
      "pack.mcmeta": {
        "hash": "0095cbc21092b960a390737fa0989ebfcbd146ab"
      },
      "assets/minecraft/optifine/emissive.properties": {
        "hash": "577d89738e60ebfbf2dbbdd5b2ff2c3400933a10"
      },
      "assets/minecraft/optifine/cem/armor_stand4.jem": {
        "hash": "9a51c3128c9c2a04a8d0b09ddb5415e57211ef7a"
      },
      "assets/minecraft/optifine/cem/armor_stand.properties": {
        "hash": "175f0a1d0e319a5cbed2d4d0964986f950141580"
      },
      "assets/minecraft/optifine/cem/armor_stand6.jem": {
        "hash": "0978feb0de7d24adabbb7385aa8d4be16d175888"
      },
      "assets/minecraft/optifine/lang/de_de.lang": {
        "hash": "468026c26e07f34cf8e92e6e6869e76510029c85"
      },
      "assets/minecraft/optifine/lang/en_us.lang": {
        "hash": "3089ef2df146fdf54c0ebe364c7840eb891766a8"
      }
    }
  }
}

the "parent" key can be used in cases where EVERY element begins with the same letter, let's say pack.mcmeta and the icon were added in another content pack, and in this one all content is stored in /assets/minecraft/optifine/contentpack83 then you write this in the "parent" value and in other places you skip it.

the "hash" key is a sha1 hashsum

Clone this wiki locally