Compatibility
Minecraft: Java Edition
1.21.x
1.20.x
1.19.1–1.19.4
1.18.1–1.18.2
1.16.3–1.16.5
Platforms
Forge
Supported environments
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
Licensed GPL-3.0-only
Published last month
Updated 5 days ago
KotlinLangForge
Provides a Kotlin language adapter for Forge and Neoforge
This mod adds a language adapter for Kotlin and provides multiple libraries.
Developer usage
To add your language adapter to your mod, add the following lines to your (neoforge.)mods.toml.
mods.toml
modLoader = "klf"
loaderVersion = "[1,)"
Now you can init your mod like any other. Just make sure your @Mod class is either a object or a class with a public and empty constructor.
If you want to implement the libraries in your mod, just import the following dependency, matching your version of Minecraft, your loader and the (latest) version of Kotlin.
build.gradle.kts
repositories {
maven("https://repo.nyon.dev/releases")
}
dependencies {
modImplementation("dev.nyon:KotlinLangForge:$version-$kotlinVersion-$mcVersion+$loader")
}
Mod Bus
To use the mod bus, just implement dev.nyon.klf.MOD_BUS
.
Libraries
- org.jetbrains.kotlin:kotlin-stdlib
- org.jetbrains.kotlin:kotlin-stdlib-jdk8
- org.jetbrains.kotlin:kotlin-stdlib-jdk7
- org.jetbrains.kotlin:kotlin-reflect
- org.jetbrains.kotlinx:kotlinx-serialization-core
- org.jetbrains.kotlinx:kotlinx-serialization-json
- org.jetbrains.kotlinx:kotlinx-serialization-cbor
- org.jetbrains.kotlinx:kotlinx-coroutines-core
- org.jetbrains.kotlinx:kotlinx-coroutines-jdk8
- org.jetbrains.kotlinx:kotlinx-datetime
- org.jetbrains.kotlinx:kotlinx-io-core
- org.jetbrains.kotlinx:kotlinx-io-bytestring
- org.jetbrains.kotlinx:atomicfu
Other
If you need help with any of my mods just join my discord server.