Hi, I’m attempting to implement Mixins into my ForgeGradle mod. I’ve setup ForgeGradle as per, and for implementing Mixin I have followed this guide (Plugin Mixins — Sponge 5.1.0 documentation). The files from the package org.spongepowered can all be used and I have setup a MixinEntityPlayerSP, and a MixinLoader that initializes the MixinBootstrap:
MixinBootstrap.init();
Mixins.addConfiguration("mixins.myplugin.json");
Here is the MixinEntityPlayerSP in question:
@Mixin(EntityPlayerSP.class)
public abstract class MixinEntityPlayerSP
{
@Inject(method = "onLivingUpdate", at = @At(value = "FIELD", opcode = Opcodes.PUTFIELD, target = "Lnet/minecraft/client/entity/EntityPlayerSP;sprintToggleTimer:I", ordinal = 1, shift = At.Shift.AFTER), cancellable = true)
public void IonLivingUpdate(CallbackInfo callback) {
System.out.println("test123");
}
}
When I add the bootstrap to the FMLInitializationEvent, it produces this output in console:
SpongePowered MIXIN Subsystem Version=0.5.17 Source=file:/C:/Users/Jamie/.gradle/caches/modules-2/files-2.1/org.spongepowered/mixin/0.5.17-SNAPSHOT/b0bd746034c6530282b5145c432ac03b23776ff2/mixin-0.5.17-SNAPSHOT.jar Env=CLIENT
[03:32:40] [Client thread/INFO]: Compatibility level set to JAVA_8
[03:32:40] [Client thread/WARN]: MixinBootstrap.doInit() called during a tweak constructor. Expect CoModificationException in 5.. 4..
However, when I place the bootstrap in my MixinLoader, there is nothing - no logs in the console, nothing at all. Even though everything is in place the Mixins don’t work at all.
Apologies if this all sounds slightly vague, I’m fairly new to Minecraft modding and I’m not very familiar with some of the processes involved. Nonetheless, if anybody has any idea how to fix this problem, then any advice would be greatly appreciated.