#can’t inject custom goals in the ZombieEntity class
9 messages · Page 1 of 1 (latest)
Why not? What are the errors? Where are you trying to inject?
I’m trying to inject a goal to the initCostumGoal class (with the inject statement from the example mixin, i just replaced the method) and it says something like “=” expected and Annotations(I’m German I have no idea what this means ) aren’t allowed. I tried injecting in the entity class as well and it worked. I have no ideas what is wrong
Uhhhh will post it tomorrow. I’m not home rn
`package de._meister.mixin;
import net.minecraft.entity.mob.ZombieEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
@Mixin(ZombieEntity.class)
public abstract class ZombieMixin {
@Inject(method = "initCustomGoals " , at = @At("HEAD"))
//some code here
}`
It will continue to display that error until you actually write your mixin method. You must write the method descriptor (public void foo(...) { ... }) and the error will go away.