Skip to main content

Loaders

Fabric

Uses Fabric Loom under the hood.

version("1.21.1") {
fabric {
loaderVersion = "0.16.2"
fabricApi("0.102.1")
datagen()

dependencies {
modImplementation("some:fabric-mod:1.0")
}
}
}
PropertyRequiredDescription
loaderVersionYesFabric Loader version
fabricApi()NoAdds Fabric API as a dependency
yarn()NoUse Yarn mappings instead of Mojang
datagen()NoEnables Fabric API datagen run

Mappings

By default, Prism uses official Mojang mappings. To use Yarn instead:

fabric {
loaderVersion = "0.18.6"
yarn("1.21.1+build.3")
}

Yarn mappings are only available for obfuscated versions (pre-26.x). On 26.x, Minecraft is unobfuscated and no mappings are needed.

Access wideners are picked up from common/src/main/resources/{modId}.accesswidener.

Datagen

When datagen() is called and Fabric API is present, Prism creates a datagen run configuration that uses Fabric API's datagen system. Generated resources output to src/main/generated and are automatically added to the source set.

Run configurations generated: client, server, and optionally datagen.

NeoForge

Uses ModDevGradle under the hood.

version("1.21.1") {
neoforge {
loaderVersion = "21.1.26"
loaderVersionRange = "[4,)"

dependencies {
implementation("some:neoforge-mod:1.0")
jarJar("some:library:[1.0,2.0)")
}
}
}
PropertyRequiredDescription
loaderVersionYesNeoForge version
loaderVersionRangeNoVersion range for template expansion

Access transformers are picked up from both common/src/main/resources/META-INF/accesstransformer.cfg and the loader's own resources.

Datagen

Prism detects the Minecraft version and configures datagen accordingly:

  • 1.21.3 and older: Single data run
  • 1.21.4 and newer: Split clientData and serverData runs

Generated resources output to src/generated/resources and are automatically added to the source set.

Forge (Legacy)

Uses ModDevGradle Legacy for Forge 1.17 through 1.20.1.

version("1.20.1") {
forge {
loaderVersion = "47.2.0"
loaderVersionRange = "[47,)"

dependencies {
implementation("some:forge-mod:1.0")
}
}
}
PropertyRequiredDescription
loaderVersionYesForge version (without MC prefix)
loaderVersionRangeNoVersion range for template expansion

The version string passed to MDG Legacy is {mcVersion}-{loaderVersion}, e.g. 1.20.1-47.2.0.

Run configurations generated: client, server, data.

Legacy Forge (1.7.10 - 1.12.2)

Uses RetroFuturaGradle for old Forge versions.

version("1.12.2") {
legacyForge {
mcVersion = "1.12.2"
forgeVersion = "14.23.5.2847"
mappingChannel = "stable" // default
mappingVersion = "39" // default
username = "Developer" // default

accessTransformer("src/main/resources/META-INF/mymod_at.cfg")
mixin() // adds MixinTweaker

dependencies {
implementation("some:library:1.0")
}
}
}
PropertyRequiredDefaultDescription
mcVersionYes1.12.2Minecraft version
forgeVersionYes-Forge version
mappingChannelNostableMCP mapping channel
mappingVersionNo39MCP mapping version
usernameNoDeveloperDev username for run configs

Requires the GTNH maven in pluginManagement:

maven { url = uri("https://nexus.gtnewhorizons.com/repository/public/") }

Java 8 toolchain with Azul JDK. Run configurations: runClient, runServer.

Custom run configurations

Every loader gets default runs (client, server, data). You can add more:

fabric {
loaderVersion = "0.18.6"
fabricApi("0.116.9+1.21.1")

runs {
client("testClient") {
username = "Dev"
}
server("secondServer") {
jvmArg("-Xmx4G")
}
}
}

neoforge {
loaderVersion = "21.1.222"

runs {
client("debugClient") {
username = "TestPlayer"
systemProperty("forge.logging.console.level", "trace")
}
}
}

Custom runs appear in IntelliJ alongside the defaults. The username field is optional and sets the in-game player name for dev runs.

Run DSL methods

MethodDescription
client(name)Creates a client run
server(name)Creates a server run
run(name) { client() }Fully custom run, set type inside
username = "..."Set dev player name
jvmArg(arg)Add JVM argument
programArg(arg)Add program argument
systemProperty(k, v)Add system property
runDir = "..."Custom run directory

Kotlin support

Enable Kotlin for all subprojects of a version:

version("1.21.1") {
kotlin() // uses Kotlin 2.1.20 by default
// or
kotlin("2.0.21") // specific version

fabric { loaderVersion = "0.16.2" }
neoforge { loaderVersion = "21.1.26" }
}

This applies org.jetbrains.kotlin.jvm to both the common and all loader subprojects, and configures the JVM target to match the Minecraft version's Java requirement.

The Kotlin plugin must be resolvable from your pluginManagement repositories.