Bootstrap Controller
This controller installs a pack into a game folder.
const { installMods } = require('@jackcooperdev/cmm/bootstrap');Functions
Section titled “Functions”installMods (packPath, destPath)
Section titled “installMods (packPath, destPath)”Parameters:
packPath: Path to the packdestPath: Game folder to install into. It is created if it does not exist.
The function:
- Copies the pack’s override files (configs etc.) into
destPath - Downloads every mod, resource pack and shader from CurseForge or Modrinth, verifying each file’s SHA1 checksum. Files that already exist and match are not downloaded again
- Removes files from
mods/that are not part of the pack - Writes
modpack.cmmandplain.jsonintodestPath
It resolves true.
It rejects with pack not found if packPath does not exist.
Warning: Any file in
destPath/modsthat is not part of the pack is deleted, including mods added by hand. Files insidemods/<minecraft version>/are left alone.
Override files that already exist in
destPathbut have been changed are not replaced, so player changes to configs are kept.
await installMods('./packs/my-pack', './instances/my-pack');Appendix
Section titled “Appendix”modpack.cmm
Section titled “modpack.cmm”Records which version of the pack is installed. plain.json contains the same data as readable JSON, and
modpack.cmm is the same data Base64 encoded.
{ "relatesTo": "<index hash from pack.json>", "index": []}relatesTo: Theindex.hashfrom the pack’spack.jsonat install timeindex: The pack’sindex.jsonat install time
