Skip to main content

Getting Started

Requirements

  • Gradle 8.8 or newer (9.x recommended)
  • JDK for your highest MC target (JDK 25 for 26.x, JDK 21 for 1.21.x, JDK 17 for 1.20.x)
  • IntelliJ IDEA (recommended)

Quick start

Three ways to create a Prism project:

Install the Prism Project Generator IntelliJ plugin. Then File > New > Project > Prism Mod. Configure your versions and loaders in the wizard and it generates everything.

Template

Use the Prism Mod Template. Click Use this template on GitHub, clone your new repo, and open it in IntelliJ.

The template comes with 1.20.1 (Fabric + Forge), 1.21.1 (NeoForge), 26.1 (Fabric), and 1.12.2 (Legacy Forge) pre-configured.

Manual setup

1. Settings file

Create settings.gradle.kts:

pluginManagement {
repositories {
maven { url = uri("https://maven.leclowndu93150.dev/releases") }
gradlePluginPortal()
mavenCentral()
maven { url = uri("https://maven.fabricmc.net/") }
maven { url = uri("https://maven.neoforged.net/releases") }
maven { url = uri("https://repo.spongepowered.org/repository/maven-public/") }
}
}

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

rootProject.name = "my-mod"

prism {
version("1.21.1") {
common()
fabric()
neoforge()
}
}

The Prism maven must be listed first in pluginManagement.repositories. The foojay plugin lets Gradle auto-download the correct JDK per Minecraft version.

2. Build file

Create build.gradle.kts:

plugins {
id("dev.prism")
}

group = "com.example"
version = "1.0.0"

prism {
metadata {
modId = "mymod"
name = "My Mod"
description = "A Minecraft mod."
license = "MIT"
author("YourName")
}

version("1.21.1") {
fabric {
loaderVersion = "0.18.6"
fabricApi("0.116.9+1.21.1")
}
neoforge {
loaderVersion = "21.1.222"
loaderVersionRange = "[4,)"
}
}
}

3. Create source directories

versions/
1.21.1/
common/src/main/java/com/example/mymod/
common/src/main/resources/
fabric/src/main/java/com/example/mymod/fabric/
fabric/src/main/resources/
neoforge/src/main/java/com/example/mymod/neoforge/
neoforge/src/main/resources/

4. Add metadata files

Place fabric.mod.json, neoforge.mods.toml, etc. in each loader's src/main/resources/. Use ${variable} placeholders that Prism expands automatically. See Template Variables for the full list.

5. Build and run

./gradlew build                        # build everything
./gradlew :1.21.1:fabric:build # build specific target
./gradlew :1.21.1:neoforge:runClient # run specific target

Run configurations appear in IntelliJ with names like Fabric Client (1.21.1) and NeoForge Client (1.21.1).

What goes where

CodeLocationHas Minecraft classes?
Shared across all versionscommon/ (requires sharedCommon())No
Shared across loaders for a versionversions/{mc}/common/Yes (vanilla)
Fabric-specificversions/{mc}/fabric/Yes (with Fabric API)
NeoForge-specificversions/{mc}/neoforge/Yes (with NeoForge)
Forge-specificversions/{mc}/forge/Yes (with Forge)

Common code can't use loader APIs (Fabric API, NeoForge events). Put loader-specific code in the loader folders.

Java toolchain

Prism sets the correct JDK per Minecraft version automatically:

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

With foojay, Gradle downloads the right JDK if it's not installed.

Next steps