Kotlin³ provides an easy-to-use Kotlin Language Adapter and helpers to develop Minecraft Mods in Kotlin.
To use Kotlin³ in your project add the following code to your build.gradle
:
repositories {
jcenter()
maven {
url = "https://dl.bintray.com/stefanwimmer128/maven"
}
}
dependencies {
// compile against Kotlin³ API
provided "eu.stefanwimmer128.kotlin3:kotlin3-api:${version}"
// at runtime include full Kotlin³ mod
runtimeOnly "eu.stefanwimmer128.kotlin3:kotlin3:${version}"
}
And create your Mod like this:
@Mod(modid = "your-mod, modLanguageAdapter = "eu.stefanwimmer128.kotlin3.api.KotlinLanguageAdapter")
object YourMod {
// put your code here
}
Additional documentation can be found here.