#Mod work in IDE but crash game when jar

4 messages · Page 1 of 1 (latest)

harsh marten
#

1.21.8 Kotlin

Crash Log:

https://mclo.gs/vhlolK3

tlm.mm.SimpleMidiModuleClient

package tlm.mm

import net.fabricmc.api.ClientModInitializer
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry
import net.minecraft.client.Minecraft
import net.minecraft.network.chat.Component

object SimpleMidiModuleClient : ClientModInitializer {

    override fun onInitializeClient() {
        EZmidicmd.register()
        PayloadTypeRegistry.playC2S().register(MidiSender.ID, MidiSender.CODEC);
    }

    fun sendChat(text: String) {
        val mc = Minecraft.getInstance()
        mc.execute { mc.player?.displayClientMessage(Component.literal(text), false) }
    }
}
rain gull
#

Maybe you are using a jar file of an older version?

gritty lintel
silent harborBOT
#

Exporting your mod as a JAR: run in a terminal from the same directory as the mod project directory ./gradlew build on GNU/Linux and Mac, or gradlew build on Windows. Alternatively, in IntelliJ IDEA, open the Gradle tab on the right and execute build under tasks. The JARs should appear in ${projectDir}/build/libs. Use the one with the shortest name outside development.