Skip to main content
Version: Minecraft 26.2

Get the mod template

A Poly Mod project starts from the mod template: a small Gradle project with an example item, block, and game tests. The template for Poly Mod Loader 0.2.0-beta.2 is on the Poly Mod Loader website's Maven repository, https://www.polymc.net/maven/.

Download and unzip​

Download the template zip for Poly Mod Loader 0.2.0-beta.2, unzip it, and rename the folder to your project's name. This tutorial calls it crystal-garden.

Invoke-WebRequest https://www.polymc.net/maven/dev/polymodloader/poly-mod-template/0.2.0-beta.2/poly-mod-template-0.2.0-beta.2.zip -OutFile poly-mod-template-0.2.0-beta.2.zip -UseBasicParsing
Expand-Archive poly-mod-template-0.2.0-beta.2.zip -DestinationPath .
Rename-Item poly-mod-template crystal-garden
cd crystal-garden

You can also download the zip in a browser: the page https://www.polymc.net/maven/ links every published template version.

What is inside​

poly-mod-template/
├─ settings.gradle.kts project name, where Gradle finds Poly Mod Loader
├─ build.gradle.kts mod plugin dev.polymodloader.mod 0.2.0-beta.2, polyResources
├─ gradle.properties Minecraft version to run (optional)
├─ gradlew, gradlew.bat, gradle/ Gradle Wrapper 9.8.1
├─ .run/runClient.run.xml IntelliJ run configuration
├─ src/main/java/com/example/mymod/MyMod.java entrypoint (a ruby item, a ruby block, 2 game tests)
├─ src/main/resources/poly.mod.json mod metadata
└─ README.md

The names my_mod, My Mod, and com.example.mymod are placeholders. The next page renames them in one command.

What you do not need to install​

Besides JDK 25 (see Requirements), you install nothing else.

  • The Gradle Wrapper in the template downloads Gradle 9.8.1.
  • Gradle downloads the dev.polymodloader.mod plugin and Poly Mod Loader itself from the website's Maven repository. The template's build.gradle.kts already names version 0.2.0-beta.2.
  • Gradle downloads Minecraft 26.2 from Mojang on the first run and verifies it by hash. After that, it uses the cache.

So the first build needs an internet connection. If the website's repository cannot be reached, the build fails; it does not fall back to anything else. When everything is in the Gradle cache, you can build offline with --offline.

Test a local Poly Mod Loader build​

This is only for contributors who have access to the Poly Mod Loader source, which is private for now. Publish your local build to Maven Local in the Poly Mod Loader source folder, then add -PpolyLocalSdk to the commands in the mod project. Without it, Gradle takes a version the website already has from the website, not from Maven Local.

Poly Mod Loader source folder
.\gradlew.bat publishToMavenLocal # the Poly Mod Loader modules
.\gradlew.bat -p build-logic publishToMavenLocal # the Gradle plugin dev.polymodloader.mod
Mod project
.\gradlew.bat build -PpolyLocalSdk

Next step​

Go on to Create the project.

Buy me a coffee