Minecraft Fabric 1.21 Modding, How do I access a private method (using a mixin)

I want to make a new registry for a new "Ability" class and for that i figured to use the createIntrusive() method from the Registries class

to do this i thaugt a mixin could help but there for what i found no ways to access a private class

this is the mixin i made:

@Mixin(Registries.class)
public abstract class RegistriesMixin {
    public static final DefaultedRegistry<Abilities> ABILITY;

    @Inject(at = @At("HEAD"), method = "<clinit>")
    private void init(CallbackInfo info) {
        ABILITY = createIntrusive(ModRegistryKeys.Power, "shoot_lazar", (registry) -> {
            return Abilities.SHOOT_LAZAR;
        });
    }
}

that gives: cannot resolve method "createIntrusive" in RegistriesMixin

Upvotes: 0

Views: 87

Answers (0)

Related Questions