Modsmith#

Build your own modpack tools

A Python toolkit for Minecraft modpacks, mod loaders and game instances. It works alongside the official launcher.

Find

Two platforms, one API

Search Modrinth and CurseForge the same way, then read releases page by page. Finding the latest version takes a single request.

import modsmith as ms

with ms.platforms.Modrinth("my-tool/1.0") as modrinth:
    project = modrinth.get_project("fabulously-optimized")
    release = next(modrinth.iter_releases(project))
    print(release.name)

Install

A modpack in a few lines

Read a pack, install its loader, sync the files and add a profile to the launcher. Every step also works on its own.

pack = ms.packs.load("fabulously-optimized.mrpack")

game = ms.minecraft.GameDir.default()
version_id = pack.loader.install(game)

instance = ms.instances.Instance.open("instances/my-pack")
instance.sync(pack)

launcher = ms.launcher.Launcher(game)
launcher.add_profile(pack.name, version_id, instance.path)

Update

Updates that respect players

Preview every change before it happens. Files the player edited stay exactly as they are, unless you choose otherwise.

added mods/sodium.jar

updated mods/iris.jar

kept config/options.toml changed by the player

removed mods/old-mod.jar

Load

Every major mod loader

One interface for all four, from Minecraft 1.13 to the latest release.

Forge1.13.2 and later
NeoForge1.20.1 and later
Fabric1.14 and later
Quilt1.14.4 and later

Recover

Nothing breaks halfway

A failed update leaves the instance as it was, so players are never stuck with half a modpack.

  1. Check Everything the pack needs is found before any file changes.
  2. Stage New files download and verify in a separate folder.
  3. Commit Files move into place, and any failure puts them all back.

Details

The hard parts are handled

The things every launcher tool has to get right.

The right Java

Find a runtime in the official launcher, or download one from Mojang.

Verified downloads

Every file is hash-checked, and interrupted downloads resume.

Works offline

Read modpacks with no network and no API key.

Ready for a GUI

Long-running calls report progress and can be cancelled.

Blocked mods

Find manually downloaded CurseForge files and verify them.

Easy to extend

Add your own platforms, pack formats and loaders.

Start building

Modsmith needs Python 3.12 or newer.