Fabric Portable: Kotlin For

For mathmatical equations The syntax is as follows: $$ E=mc^2 $$ For a list

dependencies minecraft("com.mojang:minecraft:1.20.1") mappings("net.fabricmc:yarn:1.20.1+build.10:v2") modImplementation("net.fabricmc:fabric-loader:0.14.22") // The essential Kotlin adapter modImplementation("net.fabricmc.fabric-api:fabric-api:0.83.0+1.20.1") modImplementation("net.fabricmc:fabric-language-kotlin:1.10.10+kotlin.1.9.10") Use code with caution. Copied to clipboard 2. The Entry Point kotlin for fabric

Let’s look at real modding scenarios.

package com.example import net.fabricmc.api.ModInitializer import org.slf4j.LoggerFactory object ExampleMod : ModInitializer private val logger = LoggerFactory.getLogger("modid") override fun onInitialize() logger.info("Hello from Kotlin!") Use code with caution. Copied to clipboard For mathmatical equations The syntax is as follows:

dependencies modImplementation("net.fabricmc:fabric-loader:0.14.24") modImplementation("net.fabricmc.fabric-api:fabric-api:0.91.0+1.20.4") kotlin for fabric

Scroll to Top