Tags
1. The Tag Object
Section titled “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 Fields9 available fields
idThe unique identifier of the tag.
nameThe display name of the tag.
descriptionA description of the tag.
iconThe icon associated with the tag.
headerThe header associated with the tag.
valueThe API value used to identify the tag.
featuredWhether the tag is featured by Modrinth.
projectTypeThe project type associated with the tag.
projectTypesThe project types supported by the tag.
2. The Tags Client
Section titled “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
Section titled “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 Methods11 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
Section titled “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}")}