Kore-Template
A template repository for creating a Kore project.
Kore Datapack Template
A ready-to-use starting point for building Minecraft datapacks in Kotlin with Kore.
Write Kotlin, run one Gradle task, and the generated datapack lands directly in your Minecraft world. No zip to copy by hand, no JSON to write.
Requirements
- Java Development Kit (JDK) 25 or higher
- A Minecraft installation (the template finds
.minecraftby itself)
60-second start
- Click Use this template on GitHub, or clone it:
- Open
build.gradle.ktsand setpackNameandworldsto your datapack name and your world: Not sure of the exact world name? Run./gradlew koreWorldsto list the ones Minecraft knows about. - Set the same name in
src/main/kotlin/Main.kt, in thedataPack("my_datapack")call. - Build it and copy it into your world:
Type /reload in game and your datapack is live.
The development loop
Gradle watches your sources: every save regenerates the pack and copies it into your worlds. On a dedicated server with RCON enabled, /reload is sent for you, so the loop is fully hands-free.
The password is read from the RCON_PASSWORD environment variable. A closed game or a missing password is reported and skipped, never a build failure.
Tasks
| Task | What it does |
|---|---|
koreRun |
Build, copy into every world, reload. The one to use with --continuous. |
koreBuild |
Runs Main.kt and generates the pack into build/kore. |
koreLink |
Copies the generated pack into every configured target. |
koreReload |
Sends reload to a running server over RCON. |
koreWorlds |
Lists the worlds found in your Minecraft directory. |
koreClean |
Deletes the generated pack and unlinks it from every world. |
Full options in the Gradle plugin documentation, including dedicated server folders, resource packs and symlinks instead of copies.
Writing your datapack
Everything happens inside the dataPack { } block in src/main/kotlin/Main.kt:
load("main") { } runs on every /reload, function("name") { } declares a callable function, and every data-driven resource (predicates, recipes, loot tables, advancements...) has a matching builder. Start with the official documentation.
Upgrading Kore or Kotlin is a one-line change in gradle/libs.versions.toml. The Kore version and the Gradle plugin version are the same string, so both move together.
Publishing
.github/workflows/publish.yml builds the pack and uploads it to Modrinth every time you publish a GitHub release. Set PACK_NAME and modrinth-id at the top of the file, add a MODRINTH_TOKEN repository secret with the "Create versions" scope, and the project is ready to ship.
Contributing
Issues and pull requests are welcome, on this template and on Kore itself.
Happy datapacking!
Pierre Roy