Kotlin for Forge

Mods
9,869,047 Downloads Last Updated: Apr 25, 2022 Game Version: 1.18.2   +2

Used to make mods with the Kotlin programming language. Works by shading the Kotlin libraries, providing KotlinLanguageProvider to load @Mod object declarations, providing AutoKotlinEventBusSubscriber to load @EventBusSubscriber declarations, and providing useful utility functions and constants.

 

Kotlin for Forge 1.17.0 provides: Kotlin 1.6.10, Kotlin coroutines 1.6.0, Kotlin JSON serialization 1.3.2, and Jetbrains annotations 23.0.0.
Kotlin for Forge 3.3.1 provides: Kotlin 1.6.21, Kotlin coroutines 1.6.1, and Kotlin JSON serialization 1.3.2.

 

If you're not a mod developer, this is a dependency mod.

 

Unlike Kottle, this library (as of 1.2.0) provides its own implementation of IEventBus that supports IEventBus#addListener and IEventBus#addGenericListener with function references.

 

Information for how to implement can be found here.
You do not have to use the language loader or any of the features Kotlin for Forge provides, you can just use it for the bundled Kotlin libraries.

 

If you'd like to ask for help or suggest something, feel free to do so on the Kotlin for Forge discord server.