Ryoogah
Ryoogah

Reputation: 1

FabricMC wont launch when using my IDE "Mixin transformation of net.minecraft.client.main failed"

I'm trying to create my fabric mod just to the point where I can actually launch a vanilla instance of minecraft before I actually get the the modding part, but whenever I run the runClient gradle task I get:

Uncaught exception in thread "main"
java.lang.RuntimeException: Mixin transformation of net.minecraft.client.main.Main failed
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:427)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:323)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.loadClass(KnotClassDelegate.java:218)
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:112)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:461)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    at net.fabricmc.devlaunchinjector.Main.main(Main.java:86)
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [testmod.mixins.json:net.ryoogah.testmod.mixin.json from mod testmod] from phase [DEFAULT] in config [testmod.mixins.json] FAILED during PREPARE
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:638)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinPrepareError(MixinProcessor.java:585)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:543)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.select(MixinProcessor.java:462)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.checkSelect(MixinProcessor.java:438)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:290)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:422)
8 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: The specified mixin 'net.ryoogah.testmod.mixin.net.ryoogah.testmod.mixin.json' was not found
    at org.spongepowered.asm.mixin.transformer.MixinInfo.<init>(MixinInfo.java:865)
    at org.spongepowered.asm.mixin.transformer.MixinConfig.prepareMixins(MixinConfig.java:852)
    at org.spongepowered.asm.mixin.transformer.MixinConfig.prepare(MixinConfig.java:777)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.prepareConfigs(MixinProcessor.java:540)
14 more
Caused by: java.lang.ClassNotFoundException: The specified mixin 'net.ryoogah.testmod.mixin.net.ryoogah.testmod.mixin.json' was not found
    at org.spongepowered.asm.mixin.transformer.MixinInfo.loadMixinClass(MixinInfo.java:1314)
    at org.spongepowered.asm.mixin.transformer.MixinInfo.<init>(MixinInfo.java:858)
17 more

It seems to be something with the mixins.json file because thats the only file that I'm getting an error in before running, also the crash report seems to be relating to the mixin. Using the example mod that fabric provides

I've tried deleting the net.ryoogah.testmod.mixin.ExampleMixin line all together because that's what this guys Timestamp 10:45 mixins.json file looked like. And that seemed to get rid of the error notice at the top, but when launching it still crashed with the same error.

Would it have anything to do with me using Java 18?

Upvotes: 0

Views: 14195

Answers (2)

zers
zers

Reputation: 1

if the other answer doesn't work for anyone like it didn't work for me here's what to do to fix the error

  • open your mods folder and open a folder inside of it called "bin"
  • replace the (yourmodid).mixins.json with the json from src/main/resources

Upvotes: 0

Tran Minh Tuan
Tran Minh Tuan

Reputation: 1

I have the same error but after wandering around, I finally found out how to fix it.

  1. You will go to src/client/resources/ and edit the file modid.client.mixins.json
  2. Change "package": "com.example.mixin.client" to: "package": "ryoogah.testmod.mixin",
  3. Change "client": [ "whatever inside here" ], to: "client": [ "your mixin file name" ],

Upvotes: 0

Related Questions