Kotlin for Forge

Kotlin for Forge - Minecraft Mod

Kotlin for Forge - Modding with Kotlin Language Support

Kotlin for Forge is a modding library that adds Kotlin language support for Forge mod developers by providing a Kotlin language loader and some useful utilities, depending on how one needs it. Essentially, this mod allows the merging of Kotlin into the Forge Mods ecosystem, making it much easier, or at least friendlier, through which to develop mods coded in Kotlin.

Key Features:

  • Kotlin Language Loader: The mod adds a KotlinLanguageProvider which allows the usage of @Mod object declarations and other modding annotations on Kotlin code.
  • Event Bus Support: It does support the AutoKotlinEventBusSubscriber, which enables automated handling of the @EventBusSubscriber declarations to lighten the registering event listeners in Kotlin.
  • Kotlin Standard Libraries: The mod shades the Kotlin libraries and provides essential Kotlin functionality, including:
    • Kotlin 1.4.21
    • Kotlin Coroutines 1.4.2 for asynchronous programming
    • Kotlin JSON Serialization 1.0.1
    • JetBrains annotations (20.1.0)

Compatibility

Minecraft: Java Edition

  • 1.21–1.21.3
  • 1.20.x
  • 1.19.x
  • 1.18.x
  • 1.17.x
  • 1.16.x
  • 1.15.x
  • 1.14.x

Platforms

  • Forge
  • NeoForge

Supported environments

  • Client-side
  • Server-side
  • Client and server