#Can't set Mixin compatibilityLevel to 21 like in example-project (1.20.5)

8 messages · Page 1 of 1 (latest)

opaque stump
#

Hi,
the mixins.json file from the fabric-example-mod:

{
    "required": true,
    "package": "com.example.mixin.client",
    "compatibilityLevel": "JAVA_21",
    "client": [
        "ExampleClientMixin"
    ],
    "injectors": {
        "defaultRequire": 1
    }
}

I downloaded it and testet it. Everything works. However when running the game with my mod and the following mixins.json file, I get an error:
mixins.json:

{
  "required": true,
  "package": "com.my.mod.mixins",
  "compatibilityLevel": "JAVA_21",
  "client": [
    "SomeMixin",
    "OtherMixin"
  ],
  "injectors": {
    "defaultRequire": 1
  }
}

Error:

Uncaught exception in thread "main"
...
Caused by: org.spongepowered.asm.launch.MixinInitialisationError: Mixin config mod.mixins.json specifies compatibility level JAVA_21 which is not recognised
...

When changing the compatibilityLevel to JAVA_17 everything works for some reason. Why? It doesn't seem right to leave the compatibilityLevel to JAVA_17 when my project is in JAVA_21.

vocal nexus
#

you don't have to touch that, your project will work just fine

#

leave it as JAVA_17

opaque stump
#

Alright, thanks. May I ask why I can leave that at JAVA_17 but everything else has to be Java 21 for Minecraft 1.20.5?

vocal nexus
#

it's something internal to mixins, i don't have a technical answer but that option might get removed even

opaque stump
#

Alright. Do I have to close this somewhere or can I just leave this thread as is?

high viper
#

mine works fine with compatibility level 21

#

is the compatibility levels in build.gradle set to 21?