Overview
Modrinth is a modern, open-source mod hosting platform for Minecraft. MCReleaser provides full integration with Modrinth’s API, allowing you to publish versions of your projects with complete metadata, including loaders, game versions, dependencies, and more. The platform automatically filters and validates Minecraft versions based on your specified version type (release, snapshot, etc.) and supports both the production and staging Modrinth environments.Required Credentials
To publish to Modrinth, you need:- Modrinth Token: An API token from your Modrinth account settings
- Project ID: Your project’s slug or ID (found in your project URL)
Configuration Options
The Modrinth API token for authentication. Create one from your account settings.
The project ID or slug. You can find this in your project’s URL:
https://modrinth.com/mod/[project-slug]Example: bettereconomySpace-separated list of mod loaders that your artifact supports.Valid loaders include:
bukkit, spigot, paper, purpur, sponge, fabric, forge, quilt, neoforge, velocity, bungeecord, waterfallExample:Space-separated list of Minecraft versions that your artifact supports. Can use version ranges.MCReleaser will automatically fetch and validate versions from Mojang’s version manifest.Examples:If not set, falls back to the common
GAME_VERSIONS variable.Filter game versions by type. Valid values: If not set, falls back to the common
release, snapshot, old_alpha, old_betaThis is used when resolving version ranges to determine which versions to include.GAME_VERSION_TYPE variable.The type of this release. Valid values:
release, beta, alphaThis affects how the version is displayed on Modrinth.JSON array of project dependencies. Each dependency specifies a project ID or slug and the dependency type.Dependency types:
required, optional, incompatible, embeddedExample:Whether to feature this version on your project page.
The Modrinth API endpoint to use for uploads.Valid values:
production- Production API at https://api.modrinth.comstaging- Staging API at https://staging-api.modrinth.com
Implementation Details
The Modrinth platform implementation performs the following steps:- Version Resolution: Fetches the Minecraft version manifest and filters versions based on your criteria
- Metadata Preparation: Constructs the version metadata JSON including:
- Project ID and version information
- Game versions and loaders
- Dependencies
- Featured status
- Multipart Upload: Uploads the version using a multipart POST request containing:
- JSON metadata as the
datafield - All artifact files as binary parts
- JSON metadata as the
Modrinth supports multiple files per version. MCReleaser will upload all files in your bundle and automatically designate the primary file.
Complete Example
Advanced: Dependencies Example
Here’s a complete example with dependencies for a Fabric mod:Docker
Source Code Reference
The Modrinth platform implementation can be found in:- Platform logic:
modrinth/src/main/java/me/hsgamer/mcreleaser/modrinth/ModrinthPlatform.java - Configuration keys:
modrinth/src/main/java/me/hsgamer/mcreleaser/modrinth/ModrinthPropertyKey.java