User Tools

Site Tools


tutorial:mixin_hotswaps

This is an old revision of the document!


Hotswapping Mixins

Mixins can't be hot-swapped in a default Fabric environment. To enable this functionality, you'll have to specify the -javaagent flag inside your VM options.

The only pre-requisite is having a copy of the sponge mixin jar. Fabric pulls this by default, so you should be able to locate it within your Gradle cache folder. IDEA users can look at the bottom of their project view on the left side of the screen to find the library:

Copy the full path to the jar and open up your run configurations. Under Minecraft Client, expand the VM options tab. You'll need to set the -javaagent flag to the path of the mixin jar:

Run your game. You can now reload mixins using the same rules as normal:

  • no adding or removing methods
  • no changing method parameters
  • no adding or removing fields

Notes

In my experience, Mixin hot-swapping didn't fully work until I updated to JDK 1.8.0 231 (latest). DCEVM does not support mixin swapping from what I can see:

  • When run on Java 1.8:181, DCEVM and Mixin reloads do not work.
  • When run on DCEVM Java 11, you can reload, but the hot swap task freezes.

If you're able to get DCEVM and Mixin swapping to work together, let us know!

tutorial/mixin_hotswaps.1571957137.txt.gz · Last modified: 2019/10/24 22:45 by draylar