-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
Kore is a framework for Neoforge, so the first step is to create a Neoforge project.
There are a few alternatives for starting a Neoforge project
- Intellij's Minecraft Development (recommended).
If you use Intellij IDEA, you can generate a Neoforge project directly in the IDE!
- Go to the plugin store (File>Settings>Plugins>Marketplace>Marketplace).
- Search for "Minec1raft Development" and install the plugin.
- Restart the IDE.
- Open the project creation page (File>New>Project).
- Scroll the sidebar until you find the "Minecraft" option and select it.
- Select "Neoforge", select "Kotlin" and select version 1.21.10
- Fill in the remaining fields and click "Create"
- Neoforge's Mod generator.
- Go to the Mod Generator.
- Select version 1.21.10.
- Fill in the remaining fields.
- Click "Download mod project".
- Extract the zip and open the project in your editor of choice
- MDK Templates.
- Choose the template between ModDevGradle and NeoGradle.
- Click "Use this Template".
- Fill in the fields and click Create Repository.
- Clone the repository to your machine and open the project in your editor of choice
- From scratch.
- Start a new Gradle project.
- Choose between ModDevGradle and NeoGradle.
- Follow the setup of the chosen plugin.
(This step is not necessary if you did the setup using the Minecraft Development plugin and selected "Kotlin".)
KotlinForForge is a library necessary for the use of the Kotlin language in Neoforge projects, its setup is simple:
./build.gradle
plugins {
// ...
id 'org.jetbrains.kotlin.jvm' version '2.2.20'
}or
./build.gradle.kts
plugin {
// ...
kotlin("jvm") version "2.2.0"
}./build.gradle
repositories {
// ...
maven {
name = "Kotlin for Forge"
url = "https://thedarkcolour.github.io/KotlinForForge/"
}
}or
./build.gradle.kts
repositories {
// ...
maven {
name = "Kotlin for Forge"
setUrl("https://thedarkcolour.github.io/KotlinForForge/")
}
}./build.gradle
dependencies {
// ...
implementation "thedarkcolour:kotlinforforge-neoforge:6.0.0"
}or
./build.gradle.kts
dependencies {
// ...
implementation("thedarkcolour:kotlinforforge-neoforge:6.0.0")
}./src/main/resources/META-INF/neoforge.mods.toml
modLoader="kotlinforforge"
# ...Rename the folder and remove all .java files, add src/main/kotlin/modgroup/modid/ModId.kt, we'll use it later
Done! Your project is ready to handle kotlin code!
After making sure we have KFF as a dependency of our project, we can add Kore!
This is necessary to generate the mod's entrypoint
./build.gradle
plugins {
// ...
id 'org.jetbrains.kotlin.jvm' version '2.2.20'
id 'com.google.devtools.ksp' version '2.2.21-2.0.4'
}or
./build.gradle.kts
plugin {
// ...
kotlin("jvm") version "2.2.0"
id("com.google.devtools.ksp") version "2.2.21-2.0.4"
}./build.gradle
repositories {
// ...
maven {
name = "Kotlin for Forge"
url = "https://thedarkcolour.github.io/KotlinForForge/"
}
maven {
name = "Kore"
url = "https://augustomegener.github.io/Kore/"
}
}or
./build.gradle.kts
repositories {
// ...
maven {
name = "Kotlin for Forge"
setUrl("https://thedarkcolour.github.io/KotlinForForge/")
}
maven {
name = "Kore"
setUrl("https://augustomegener.github.io/Kore/")
}
}./build.gradle
dependencies {
// ...
implementation "thedarkcolour:kotlinforforge-neoforge:6.0.0"
implementation "augustomegener:Kore:<Lastest Version>"
ksp "augustomegener.kore:ksp:<Lastest Version>"
}or
./build.gradle.kts
dependencies {
implementation("thedarkcolour:kotlinforforge-neoforge:6.0.0")
implementation("augustomegener:Kore:<Lastest Version>")
ksp("augustomegener.kore:ksp:<Lastest Version>")
}./src/main/resources/META-INF/neoforge.mods.toml
# ...
[[dependencies.${mod_id}]]
modId="kore"
type="required"
versionRange="[0.1.0,)"
ordering="NONE"
side="BOTH"src/main/kotlin/modgroup/modid/ModId.kt
@KMod
fun init() {
}Done! Your project is ready for development with Kore!