Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

why Inferred type 'I' for type parameter 'I' is not within its bound; should extend 'net.minecraft.potion.Effect'.


Creeper001
 Share

Recommended Posts

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'.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

@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.

 

Link to comment
Share on other sites

@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"));
    }

 

Link to comment
Share on other sites

@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?

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • can someone tell me what is messing up my minecraft??? I have been trying the half and half method for hrs and I can't seem to fine the culprit. Here is my latest crash report: 02:09:39.174 game at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) 02:09:39.174 game at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) 02:09:39.174 game at java.base/java.lang.Thread.run(Thread.java:833) 02:09:39.174 game Caused by: org.spongepowered.asm.mixin.throwables.ClassMetadataNotFoundException: com.simibubi.create.repack.registrate.util.entry.BlockEntry 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transformMethod(MixinPreProcessorStandard.java:754) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.transform(MixinPreProcessorStandard.java:739) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:310) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:280) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1288) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:292) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) 02:09:39.174 game at MC-BOOTSTRAP/org.spongepowered.mixin/org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) 02:09:39.174 game ... 34 more 02:09:39.778 monitor Process Monitor Process crashed with exit code 1
    • https://myfemalefunda.com/الساعة-الان-في-المكسيك/ https://myfemalefunda.com/معلومات-عن-شي-ان/ https://kerbymethodconsulting.com/مستقبل-الطاقة-فى-مصر-95969/ https://sanakanwalfashion.com/وظائف-مصنع-ابو-هشيمة/ https://enjazalkhaleej.com/اسعار-دولار-مقابل-يورو/
    • https://enjazalkhaleej.com/رقم-شركة-ابل-في-مصر/ https://enjazalkhaleej.com/كيف-يتم-تحديد-قيمة-العملة/ https://diamonds.tokyo/بحث-عن-مشكلة-الكهرباء-وحلها/ https://enjazalkhaleej.com/ما-هو-خام-البليت/ https://myfemalefunda.com/تحويل-العمله-من-ريال-سعودي-الى-ريال-عما/
    • https://kerbymethodconsulting.com/بيع-وشراء-وادي-سوف-49397/ https://myfemalefunda.com/عملة-اليورو-اي-دولة/ https://angosiam.com/سعر-عملة-داج-كوين/ https://angosiam.com/100-دولار-كم-ليره/ https://advocatesnairobi.com/جورج-السادس-ملك-المملكة-المتحدة/
    • https://advocatesnairobi.com/هل-العملات-الرقمية-حلال/ https://sanakanwalfashion.com/عروض-البلاك-فرايدي-2022/ https://advocatesnairobi.com/سعر-الدينار-الليبي-اليوم-في-مصر/ https://starsone.site/اسعار-العملات-اليوم-فى-قطر/ https://angosiam.com/تحويل-بتكوين-الى-دولار/
  • Topics

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.