Skip to main content

FAQ

Can I use Kotlin?

Yes. Add kotlin() to your version block:

version("1.21.1") {
kotlin() // uses 2.1.20 by default
kotlin("2.0.21") // or pick a version
}

This applies the Kotlin JVM plugin to common and all loader subprojects, with the JVM target matching the Minecraft version.

Can I use Yarn mappings?

Yes, for Fabric on obfuscated versions (pre-26.x):

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

If yarn() is not set, Prism uses official Mojang mappings by default. On 26.x (unobfuscated), no mappings are needed and Yarn is not applicable.

Do I need common() for every version?

No. If a version only targets one loader, skip common():

version("1.21.1") {
neoforge() // single-loader mode, no common/loader split
}

The version folder itself becomes the project (versions/1.21.1/src/main/java/). No subdirectories needed. Build with ./gradlew :1.21.1:build.

Use common() only when you have multiple loaders and want shared code between them.

Can I use Fabric API in common code?

No. The version-specific common project (versions/{mc}/common/) only has access to vanilla Minecraft classes. Loader APIs like Fabric API, NeoForge events, or Forge events are only available in the loader-specific folders.

Put shared logic that doesn't touch loader APIs in common, and put loader-specific code (event handlers, registration) in the loader folders.

Can I share code between versions?

By default, no. Each version is fully independent.

If you have pure Java code (interfaces, annotations, utilities) that doesn't touch Minecraft APIs, enable the shared common:

// settings.gradle.kts
prism {
sharedCommon()
version("1.20.1") { ... }
version("1.21.1") { ... }
}

This creates a root common/ folder compiled with the lowest Java version across your targets. It has no access to Minecraft classes. See Project Structure for details.

How do I add dependencies?

Use the dependencies block inside each loader config, or common for shared dependencies:

version("1.21.1") {
common {
implementation("some:shared-lib:1.0")
}
fabric {
loaderVersion = "0.18.6"
dependencies {
modImplementation("curse.maven:jei-238222:4613379")
}
}
}

See Dependencies for details.

How do I use CurseMaven or Modrinth Maven?

prism {
curseMaven()
modrinthMaven()
}

Then use curse.maven:slug-projectId:fileId or maven.modrinth:slug:version in your dependency blocks.

How do I embed a library in my JAR?

Use jarJar() in the dependency block:

fabric {
dependencies {
jarJar("some:library:1.0") // uses Fabric's include
}
}
neoforge {
dependencies {
jarJar("some:library:[1.0,2.0)") // uses NeoForge's jarJar
}
}

How does datagen work?

Fabric: Call datagen() in your fabric config. Requires Fabric API. Output goes to src/main/generated.

NeoForge: Prism auto-detects the Minecraft version:

  • 1.21.3 and older: single data run
  • 1.21.4 and newer: split clientData and serverData runs

Output goes to src/generated/resources.

Forge: Single data run. Output goes to src/generated/resources.

How do I add custom run configurations?

Use the runs block inside any loader config:

fabric {
loaderVersion = "0.18.6"
runs {
client("testClient") { username = "Dev" }
server("secondServer") { }
}
}

See Loaders for the full run DSL.

How does publishing work?

See Publishing. Key points:

  • Display name on CurseForge/Modrinth defaults to the JAR filename (e.g. mymod-1.21.1-NeoForge-1.0.0.jar)
  • Override with displayName in the publishing block
  • Publishing dependencies (requires, optional, incompatible) can be set globally, per version, or per loader
  • All three levels stack

How do I add access wideners or access transformers?

Prism auto-detects these. Just place them in the right location.

Access wideners (Fabric): Place {modId}.accesswidener in either:

  • versions/{mc}/fabric/src/main/resources/ (loader-specific, takes priority)
  • versions/{mc}/common/src/main/resources/ (shared)

Access wideners work on all versions including 26.x. Unobfuscated means names aren't scrambled, not that everything is public.

Access transformers (NeoForge/Forge): Place accesstransformer.cfg in META-INF/ under either:

  • versions/{mc}/common/src/main/resources/META-INF/
  • versions/{mc}/neoforge/src/main/resources/META-INF/ (or forge/)

Both locations are checked and combined.

How does the common project compile?

For 1.20.2+, the common subproject uses ModDevGradle with neoFormVersion (vanilla Minecraft, no loader).

For 1.20.1 and older, it uses MDG Legacy with mcpVersion set to the Minecraft version.

In both cases, common has full access to vanilla Minecraft classes but not loader APIs.

Common source files are recompiled as part of each loader's compilation, so they have access to the full loader classpath at build time.

NeoForm version resolution fails

  1. Check your internet connection. Prism fetches from maven.neoforged.net.
  2. If offline, set neoFormVersion manually in the version block.
  3. Cache is at ~/.gradle/caches/prism/neoform-versions.txt (24h TTL). Delete to refresh.

Run configurations are missing

Reload the Gradle project in IntelliJ after changing the Prism configuration. Runs are generated during Gradle sync.

What Gradle version do I need?

Gradle 8.8 or newer. 9.x recommended.

What Java version do I need?

You need the highest JDK required by any of your targets. Prism sets the correct toolchain per version automatically:

MinecraftJava
1.18.x - 1.20.x17
1.21.x21
26.x25

Add the foojay toolchain resolver so Gradle auto-downloads missing JDKs:

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}

Override with javaVersion in the version block.