Creeper001 Posted December 2, 2021 Posted December 2, 2021 public static final DeferredRegister<Effect> EFFECTS = DeferredRegister.create(ForgeRegistries.POTIONS, Utils.MOD_ID); public static final RegistryObject<Effect> bl_instinct = EFFECTS.register("bl_instinct", BLInstinct::new); why Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.potion.Effect'. Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 public class BLInstinct extends Effect { public BLInstinct(EffectType type, int hexColor){ super(EffectType.NEUTRAL,0x993333); } } Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 7 minutes ago, diesieben07 said: Show the BLInstinct class. public class BLInstinct extends Effect { public BLInstinct(EffectType type, int hexColor){ super(EffectType.NEUTRAL,0x993333); } } Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 16 minutes ago, diesieben07 said: Look at which arguments the register method requires. Look at what you are providing it. Realize it does not match up, then fix it. I don not know where does not match up. Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.potion.Effect' net.minecraftforge.registries.DeferredRegister<T extends IForgeRegistryEntry<T>> public <I extends T> net.minecraftforge.fml.RegistryObject<I> register(String name, java.util.function.Supplier<? extends I> sup Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 @SubscribeEvent public static void onPotionRegistration(RegistryEvent.Register<Effect> event) { event.getRegistry().registerAll(new BLInstinct(EffectType.NEUTRAL,0x993333).addAttributeModifier(Attributes.MAX_HEALTH,"7107DE5E-7CE8-4030-940E-514C1F160890",0.5f, AttributeModifier.Operation.MULTIPLY_TOTAL).setRegistryName(Utils.MOD_ID, "bl_instinct")); } This way no erro,but there is no effect in game. 52 minutes ago, diesieben07 said: register requires a supplier for the registry type (in your case Effect). You are giving it a constructor reference that does not match up with the functional interface Supplier. If you don't know what constructor/method references, lambdas and functional interfaces are - look them up. Or don't use them, you can implement the interface normally, too. Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 @SubscribeEvent public static void onPotionRegistration(RegistryEvent.Register<Effect> event) { event.getRegistry().registerAll(new BLInstinct(EffectType.NEUTRAL,0x993333).addAttributeModifier(Attributes.MAX_HEALTH,"7107DE5E-7CE8-4030-940E-514C1F160890",0.5f, AttributeModifier.Operation.MULTIPLY_TOTAL).setRegistryName(Utils.MOD_ID, "bl_instinct")); } Quote
Luis_ST Posted December 2, 2021 Posted December 2, 2021 9 minutes ago, diesieben07 said: Is the event handler called? Check using the debugger. Did you check that? Quote
Creeper001 Posted December 2, 2021 Author Posted December 2, 2021 @Mod.EventBusSubscriber() public class Registry { @SubscribeEvent public static void onPotionRegistration(RegistryEvent.Register<Effect> event) { event.getRegistry().registerAll(new BLInstinct(EffectType.NEUTRAL,0x993333).addAttributeModifier(Attributes.MAX_HEALTH,"7107DE5E-7CE8-4030-940E-514C1F160890",0.5f, AttributeModifier.Operation.MULTIPLY_TOTAL).setRegistryName(Utils.MOD_ID, "bl_instinct")); } } @Mod.EventBusSubscriber() is this event handler? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.