Getting Started¶
Add Maven Repository¶
Regardless if you’re using Fabric, NeoForge, or Architectury, you need to add the Modrinth maven to your project’s build.gradle.
In the appropriate build.gradle:
repositories {
// ...
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
Note
Repository Declaration
By adding the Modrinth maven in this way, you’re telling gradle to only look for dependencies with the group “maven.modrinth” in the Modrinth maven.
A regular declaration would look like this:
repositories {
// ...
maven {
name = "Modrinth" // optional
url = "https://api.modrinth.com/maven"
}
}
You can read more about the Modrinth maven here.
Then, declare the dependency:
dependencies {
// ...
modImplementation "maven.modrinth:arrp-but-different:VERSION"
}
Creating Packs¶
For both Fabric and NeoForge you need to register an event listener, but the process is a bit different depending on the loader.
Important
Mappings
All code examples are in mojmap.
Fabric¶
To add a new pack on Fabric, you need to register a listener, in your mod initializer, through the ARRPEvent class.
See the example below:
public class ARRPExample implements ModInitializer {
@Override
public void onInitialize() {;
ARRPEvent.BEFORE_USER.register((resourcePacks) -> {
// Creates the resource pack
RuntimeResourcePack pack = RuntimeResourcePack.create(ResourceLocation.fromNamespaceAndPath("mod_id", "example_pack"));
// Adds the resource pack to the list. If this is not done, your resource pack will never be used and will not load.
resourcePacks.add(pack);
}));
}
}
NeoForge¶
To add a new pack on NeoForge, you need to register a listener through the ARRPForNeoForge.ARRP_EVENT_BUS static variable.
See the example below:
@Mod("mod_id")
public class ARRPExample {
@Override
public void onInitialize() {;
ARRPForNeoForge.ARRP_EVENT_BUS.register((ARRPNeoForgeEvent.BeforeUser) -> {
// Creates the resource pack
RuntimeResourcePack pack = RuntimeResourcePack.create(ResourceLocation.fromNamespaceAndPath("mod_id", "example_pack"));
// Adds the resource pack to the list. If this is not done, your resource pack will never be used and will not load.
event.addPack(pack);
}));
}
}
Use The Runtime Resource Pack¶
The RuntimeResourcePack interface provides numerous ways to add resources and data to the pack. The following pages document such methods.
Warning
This list is incomplete!