Skip to content

Set up a NeoForge mod

Checked against Linen’s templates on 2 November 2026. Every value on this page is copied from the template files themselves: gradle.properties, build.gradle, settings.gradle and the Gradle wrapper.

Minecraft Java Gradle Gradle runs on Gradle plugin Names in code
1.20.1 17 8.14.5 Java 21 net.neoforged.moddev.legacyforge 2.0.148 Parchment (default) or Mojang names
1.20.2 17 8.14.5 Java 17 net.neoforged.gradle.userdev 7.0.116 Parchment (default) or Mojang names
1.20.4 17 9.2.1 Java 17 net.neoforged.moddev 2.0.148 Parchment (default) or Mojang names
1.20.5 21 9.2.1 Java 21 net.neoforged.gradle.userdev 7.1.39 Parchment (default) or Mojang names
1.20.6 – 1.21.11 21 9.2.1 Java 21 net.neoforged.moddev 2.0.148 Parchment (default) or Mojang names
26.1 and newer 25 9.2.1 Java 25 net.neoforged.moddev 2.0.148 Mojang’s names, built into the game
  • The NeoForge builds offered start at 20.2.59-beta on 1.20.2, 20.4.239 on 1.20.4, 20.6.122 on 1.20.6 and 26.1.0.0-beta on 26.1.
  • “Parchment” means Mojang’s names with Parchment’s parameter names and javadocs on top.
  • On 1.20.1 the template still uses Forge-style version ranges (forge_version_range=[47.1,)), and the built jar is remapped to the SRG names 1.20.1 runs with.
  • Every project gets a mixin config (<modid>.mixins.json) and an access transformer at src/main/resources/META-INF/accesstransformer.cfg.
  • settings.gradle applies org.gradle.toolchains.foojay-resolver-convention 1.0.0, which lets Gradle download a missing Java version (Gradle docs).

Linen also keeps one template per version with every number fixed, taken from NeoForge’s official MDKs:

Minecraft NeoForge Gradle plugin Java Gradle Names in code
1.21.1 21.1.255 net.neoforged.moddev 2.0.148 21 9.2.1 Mojang names + Parchment 2024.11.17
1.21.11 21.11.45 net.neoforged.moddev 2.0.148 21 9.2.1 Mojang names + Parchment 2025.12.20
26.1.2 26.1.2.114 net.neoforged.moddev 2.0.148 25 9.2.1 Mojang’s names, built in
26.2 26.2.0.88 net.neoforged.moddev 2.0.148 25 9.2.1 Mojang’s names, built in
26.3 26.3.0.23-beta (a beta) net.neoforged.moddev 2.0.147 25 9.2.1 Mojang’s names, built in

From 26.1 the parchment { ... } block and the parchment_* lines in gradle.properties are gone. In the ModDevGradle templates the data run uses data() up to 1.21.3 and clientData() from 1.21.4.

Task Command
Build the mod jar (in build/libs/) ./gradlew build
Start the game with your mod ./gradlew runClient
Start a test server ./gradlew runServer
Run data generation (output in src/generated/resources/) ./gradlew runData

The build also defines a gameTestServer run. The first time you start a test server it stops at once: accept the EULA in eula.txt in the run folder, and set online-mode=false in server.properties to join with the dev player (NeoForge docs). On Windows, use gradlew.bat or .\gradlew.

NeoForge’s own guide: Getting Started with NeoForge.

  • New mod writes these projects. Pick a loader and a version; Ctrl or Shift and a click adds more, so one mod can target several versions or loaders at once.
  • Linen installs the Java version the project needs.
  • Play the game runs the dev client with the Game Log; if it crashes, Crash Doctor says why.
  • Linen Check reads registrations, models, loot tables, names, mixins and the build, and names the file and the fix.
  • Hovers show names in Mojang, Yarn, intermediary and Parchment, where the version has them.