Tags

1. The Tag Object

The Tag class represents a tag returned by the Modrinth tag endpoints. Tags can be used to categorize projects and provide metadata for search filters.

Depending on the tag type, different fields may be available.

Tag Fields 9 available fields
id

The unique identifier of the tag.

Type: String
name

The display name of the tag.

Type: String
description

A description of the tag.

Type: String
icon

The icon associated with the tag.

Type: String
header

The header associated with the tag.

Type: String
value

The API value used to identify the tag.

Type: String
featured

Whether the tag is featured by Modrinth.

Type: boolean
projectType

The project type associated with the tag.

Type: ProjectType
projectTypes

The project types supported by the tag.

Type: String[]

2. The Tags Client

The TagsClient provides access to the tags and metadata available through the Modrinth API.

Access it through the main Modrinth client:

modrinth.tags()

3. Getting Tags

Each method returns a different type of tag or metadata.

List<Tag> categories = modrinth.tags().categories();
List<Tag> loaders = modrinth.tags().loaders();
List<Tag> versions = modrinth.tags().versions();
TagsClient Methods 11 available methods
categories()

Returns all available project categories.

Returns: List<Tag>
loaders()

Returns all available mod loaders and platforms.

Returns: List<Tag>
versions()

Returns all available Minecraft versions.

Returns: List<Tag>
users()

Returns the available user tags.

Returns: List<Tag>
teams()

Returns the available team tags.

Returns: List<Tag>
versionFiles()

Returns the available version file tags.

Returns: List<Tag>
tags()

Returns general Modrinth tags.

Returns: List<Tag>
licenses()

Returns all available project licenses.

Returns: List<License>
projectTypes()

Returns all available project types.

Returns: List<ProjectType>
sideTypes()

Returns all available client and server side support types.

Returns: List<SideSupport>
donationPlatforms()

Returns all available donation platforms.

Returns: List<Tag>

4. Example

For example, you can retrieve all loaders and inspect their API values:

List<Tag> loaders = modrinth.tags().loaders();

for (Tag loader : loaders) {
    System.out.println(loader.name + ": " + loader.value);
}

{/* I need to find some funny comment to put here, but I can't think of anything right now, so I'll just leave this here. */}