COWMODSКаталог модов

KotlinLangForge

Provides a Kotlin language adapter for Forge and Neoforge

Автор: btwonion1,6 млн49обновлён 20 окт. 2026 г.
Библиотеки

Описание

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.

neoforge.mods.toml

modLoader = "klf"
loaderVersion = "[1,)"

Now you can init your mod like any other. Just make sure your @Mod class is either an object or a class with a public constructor. The constructor can take the following four arguments (they should never duplicate):

  • IEventBus
  • ModContainer
  • KotlinModContainer
  • Dist

If you want to implement the libraries in your mod, import the following dependency, matching the language provider version, your loader and the (latest) version of Kotlin.

Versioning

The "language provider version" is a version only provided by KotlinLangForge. This format is not used by Forge or NeoForge and only serves as a simple differentiation variable between the different language provider implementations over the course of the versions of Minecraft.

version of Minecraftlanguage provider versionsupported loaders
1.16.51.0Forge
1.17.1 - 1.20.42.0Forge, NeoForge
1.20.5 - 1.21.83.0NeoForge
1.21.9 - 26.x3.1NeoForge

build.gradle.kts

repositories {
    maven("https://repo.nyon.dev/releases")
}

dependencies {
    implementation("dev.nyon:KotlinLangForge:2.16.0-k2.4.21-$lpVersion+$loader")
}

For lp: <=3.0, you will have to use modImplementation.

Events

To use automatic event listener registration, the @EventBusSubscriber annotation has to be added on the class/file. Klf then will automatically find all methods that have events in their parameters and will determine which event bus to use. Additionally, you can annotate a method with @SubscribeEvent to adjust the listener's parameters.

Note for Forge developers: Private event listeners cannot be processed on Forge and will result in a crash!

Mod Bus: The mod bus is available via the top-level declaration dev.nyon.klf.MOD_BUS.

Included Libraries

  • org.jetbrains.kotlin:kotlin-stdlib:2.4.21
  • org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.4.21
  • org.jetbrains.kotlin:kotlin-stdlib-jdk7:2.4.21
  • org.jetbrains.kotlin:kotlin-reflect:2.4.21
  • org.jetbrains.kotlinx:kotlinx-serialization-core:1.12.0
  • org.jetbrains.kotlinx:kotlinx-serialization-json:1.12.0
  • org.jetbrains.kotlinx:kotlinx-serialization-cbor:1.12.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-core:1.11.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:1.11.0
  • org.jetbrains.kotlinx:kotlinx-datetime:0.8.0-0.6.x-compat
  • org.jetbrains.kotlinx:kotlinx-io-core:0.9.1
  • org.jetbrains.kotlinx:kotlinx-io-bytestring:0.9.1
  • org.jetbrains.kotlinx:atomicfu:0.33.0

Other

If you need help with any of my mods, just join my discord server.

Последние версии

Все версии →
release

v2.16.0-k2.4.21-3.1+neoforge

2.16.0-k2.4.21-3.1+neoforge
20 окт. 2026 г.46,6 тыс.Minecraft: 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, 26.3neoforge
Скачать
Что нового
# v2.16.0-k2.4.21-3.1+neoforge - build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-core from 1.11.0 to 1.12.0 in /klf
release

v2.16.0-k2.4.21-3.0+neoforge

2.16.0-k2.4.21-3.0+neoforge
20 окт. 2026 г.53,4 тыс.Minecraft: 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8neoforge
Скачать
Что нового
# v2.16.0-k2.4.21-3.0+neoforge - build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-core from 1.11.0 to 1.12.0 in /klf
release

v2.16.0-k2.4.21-2.0+neoforge

2.16.0-k2.4.21-2.0+neoforge
20 окт. 2026 г.38Minecraft: 1.20.2, 1.20.3, 1.20.4neoforge
Скачать
Что нового
# v2.16.0-k2.4.21-2.0+neoforge - build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-core from 1.11.0 to 1.12.0 in /klf
release

v2.16.0-k2.4.21-2.0+forge

2.16.0-k2.4.21-2.0+forge
20 окт. 2026 г.2,2 тыс.Minecraft: 1.17.1, 1.18.2, 1.19.2, 1.19.4, 1.20.1, 1.20.2, 1.20.3, 1.20.4forge
Скачать
Что нового
# v2.16.0-k2.4.21-2.0+forge - build(deps): bump org.jetbrains.kotlinx:kotlinx-serialization-core from 1.11.0 to 1.12.0 in /klf
release

v2.15.0-k2.4.21-3.1+neoforge

2.15.0-k2.4.21-3.1+neoforge
8 окт. 2026 г.79,8 тыс.Minecraft: 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, 26.3neoforge
Скачать
Что нового
# v2.15.0-k2.4.21-3.1+neoforge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load - build(deps): bump org.jetbrains.kotlin.jvm from 2.4.20 to 2.4.21
release

v2.15.0-k2.4.21-3.0+neoforge

2.15.0-k2.4.21-3.0+neoforge
8 окт. 2026 г.99,2 тыс.Minecraft: 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8neoforge
Скачать
Что нового
# v2.15.0-k2.4.21-3.0+neoforge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load - build(deps): bump org.jetbrains.kotlin.jvm from 2.4.20 to 2.4.21
release

v2.15.0-k2.4.21-2.0+neoforge

2.15.0-k2.4.21-2.0+neoforge
8 окт. 2026 г.30Minecraft: 1.20.2, 1.20.3, 1.20.4neoforge
Скачать
Что нового
# v2.15.0-k2.4.21-2.0+neoforge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load - build(deps): bump org.jetbrains.kotlin.jvm from 2.4.20 to 2.4.21
release

v2.15.0-k2.4.21-2.0+forge

2.15.0-k2.4.21-2.0+forge
8 окт. 2026 г.4 тыс.Minecraft: 1.17.1, 1.18.2, 1.19.2, 1.19.4, 1.20.1, 1.20.2, 1.20.3, 1.20.4forge
Скачать
Что нового
# v2.15.0-k2.4.21-2.0+forge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load - build(deps): bump org.jetbrains.kotlin.jvm from 2.4.20 to 2.4.21
release

v2.15.0-k2.4.20-3.1+neoforge

2.15.0-k2.4.20-3.1+neoforge
7 окт. 2026 г.3 тыс.Minecraft: 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2, 26.3neoforge
Скачать
Что нового
# v2.15.0-k2.4.20-3.1+neoforge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load
release

v2.15.0-k2.4.20-3.0+neoforge

2.15.0-k2.4.20-3.0+neoforge
7 окт. 2026 г.6,9 тыс.Minecraft: 1.20.5, 1.20.6, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8neoforge
Скачать
Что нового
# v2.15.0-k2.4.20-3.0+neoforge - fix automatic event subscriber crashes on zero-argument methods and duplicate registrations for mods with multiple entrypoints - fix legacy mod instance lookup and loading context access - forward Forge config loading and reloading events to the mod event bus - improve loading errors for incompatible KotlinLangForge artifacts, invalid mod constructors, and invalid annotated event handlers - preserve original exception causes in mod loading errors - improve early KLF/KFF compatibility diagnostics, including a Preloading Tricks suggestion when callbacks cannot load