#can’t inject custom goals in the ZombieEntity class

9 messages · Page 1 of 1 (latest)

rare eagle
#

Basically the title. Somehow can’t use @Inject.

mild coral
#

Why not? What are the errors? Where are you trying to inject?

rare eagle
#

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

mild coral
#

Annotation means @Something

#

Show your mixin please

rare eagle
#

Uhhhh will post it tomorrow. I’m not home rn

rare eagle
#

`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

}`

candid swift
#

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.