Projects

1. The Project Object

The Project class represents a project returned by the Modrinth API.

A project can contain metadata such as its title, description, supported Minecraft versions, loaders, download count, gallery images, links, and more.

Project project = modrinth.projects().get("sodium");

You can access project metadata directly:

String title = project.title;
String description = project.description;
long downloads = project.downloads;

2. Fields

The available fields depend on whether the project was returned by a search endpoint or a detail endpoint.

Project Fields Project metadata
id Detail

The unique Modrinth project ID returned by the detail endpoint.

Type: String
projectId Search

The unique Modrinth project ID returned by the search endpoint.

Type: String
slug

The human-readable identifier of the project.

Type: String
title

The display name of the project.

Type: String
description

A short description of the project.

Type: String
body Detail

The full project description.

Type: String
bodyUrl

Legacy field, always null according to the Modrinth API.

Type: String
projectType

The type of content provided by the project.

Type: ProjectType
monetizationStatus

The monetization status of the project.

Type: String
author

The display name of the project author.

Type: String
authorId

The unique ID of the project author.

Type: String
organization

The organization that owns the project, if available.

Type: String
organizationId

The unique ID of the organization that owns the project, if available.

Type: String
team

The ID of the team associated with the project.

Type: String
clientSide

Describes the project's client-side support.

Type: SideSupport
serverSide

Describes the project's server-side support.

Type: SideSupport
environment

Replaces clientSide/serverSide as the preferred way to describe where the project runs. Both are still populated, but prefer this field going forward.

Type: Environment[]
categories

The categories and tags assigned to the project.

Type: String[]
displayCategories

The subset of categories shown on the project's search card.

Type: String[]
additionalCategories

Categories assigned to the project that aren't primary categories.

Type: String[]
versions

The IDs of every version published under the project.

Type: String[]
gameVersions

The Minecraft versions supported by the project.

Type: String[]
loaders

The mod loaders and platforms supported by the project.

Type: String[]
disclosureTypes Search

Content disclosure categories (AI content, telemetry, advertisements, and so on) the project is tagged with, returned by the search endpoint only.

Type: DisclosureType[]
downloads

The total number of project downloads.

Type: long
follows Search

The number of project followers returned by the search endpoint.

Type: long
followers Detail

The number of project followers returned by the detail endpoint.

Type: long
iconUrl

The URL of the project's icon.

Type: String
rawIconUrl Detail

The unoptimized icon, returned by the detail endpoint only.

Type: String
color

The project's display color.

Type: Integer
threadId

The ID of the moderation thread associated with the project.

Type: String
issuesUrl

The URL of the project's issue tracker, if any.

Type: String
sourceUrl

The URL of the project's source code repository, if any.

Type: String
wikiUrl

The URL of the project's wiki page, if any.

Type: String
discordUrl

The invite URL of the project's Discord server, if any.

Type: String
donationUrls

The donation platforms and links listed for the project.

Type: DonationUrl[]
license

License information for the project.

Type: ProjectLicense
gallery

The images available in the project's gallery.

Type: GalleryImage[]
published

The time at which the project was published.

Type: Instant
updated

The time at which the project was last updated.

Type: Instant

3. Convenience Methods

The Project class provides convenience methods for common project checks and metadata access.

Project Methods Metadata and compatibility helpers
getTags()

Returns the project's categories as tags.

Returns: String[]
getDisplayTags()

Returns the subset of tags shown on the project's search card.

Returns: String[]
getAdditionalTags()

Returns tags assigned to the project that aren't primary categories.

Returns: String[]
hasTag()

Checks whether the project contains a specific tag.

Returns: boolean
hasDisplayTag()

Checks whether the project contains a specific display tag.

Returns: boolean
hasAdditionalTag()

Checks whether the project contains a specific additional tag.

Returns: boolean
hasLoader()

Checks whether the project supports a loader.

Accepts: String or ModLoader

supportsVersion()

Checks whether the project supports a Minecraft version.

Returns: boolean
supportsEnvironment()

Checks whether the project supports a specific Environment value.

Returns: boolean
hasDisclosure()

Checks whether the project is tagged with a specific DisclosureType.

Returns: boolean
getFeaturedGallery()

Returns the featured gallery image, if one exists.

Returns: GalleryImage
getLatestVersion()

Resolves the latest matching version of the project.

Returns: Version

Checking Compatibility

boolean supportsFabric = project.hasLoader(ModLoader.FABRIC);
boolean supportsVersion = project.supportsVersion("1.21.11");

if (supportsFabric && supportsVersion) {
    // The project supports Fabric on Minecraft 1.21.11
}

Working with Tags

boolean optimization = project.hasTag("optimization");
boolean technology = project.hasDisplayTag("technology");

Checking Environment and Disclosures

boolean clientOnly = project.supportsEnvironment(Environment.CLIENT_ONLY);
boolean usesTelemetry = project.hasDisclosure(DisclosureType.TELEMETRY);

getFeaturedGallery() returns the gallery image marked as featured, or null if the project has no featured image.

GalleryImage featured = project.getFeaturedGallery();

if (featured != null) {
    System.out.println(featured.url);
}

4. Resolving the Latest Version

A project returned by a Modrinth client is automatically attached to that client. This allows you to resolve the latest matching version directly from the project.

By Game Version and Loader

Version latest = project.getLatestVersion(
        "1.21.11",
        ModLoader.FABRIC
);

With Version Search Options

For more control, pass a VersionSearchOptions object:

VersionSearchOptions options = VersionSearchOptions.builder()
        .gameVersions("1.21.11")
        .loaders("fabric")
        .build();

Version latest = project.getLatestVersion(options);