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.
name
The display name of the tag.
description
A description of the tag.
icon
The icon associated with the tag.
header
The header associated with the tag.
value
The API value used to identify the tag.
featured
Whether the tag is featured by Modrinth.
projectType
The project type associated with the tag.
projectTypes
The project types supported by the tag.
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();val categories = modrinth.tags().categories()
val loaders = modrinth.tags().loaders()
val versions = modrinth.tags().versions()TagsClient Methods 11 available methods
categories()
Returns all available project categories.
loaders()
Returns all available mod loaders and platforms.
versions()
Returns all available Minecraft versions.
users()
Returns the available user tags.
teams()
Returns the available team tags.
versionFiles()
Returns the available version file tags.
tags()
Returns general Modrinth tags.
licenses()
Returns all available project licenses.
projectTypes()
Returns all available project types.
sideTypes()
Returns all available client and server side support types.
donationPlatforms()
Returns all available donation platforms.
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);
}val loaders = modrinth.tags().loaders()
for (loader in loaders) {
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. */}