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

[1.6.1] How to add "performEffect" to my custom potion effect?


Recommended Posts

So recently I was working on my mod that adds custom potions.
I did manage to make the effect by watching tutorials but couldn't figure out how to add the performEffect so the effect does nothing currently.

Any help?

 

↓Code that registers it(Main)↓ 

@SubscribeEvent
        public static void onEffectsRegistry(final RegistryEvent.Register<Effect> effectRegistryEvent) {
            // register a new effect here
            LOGGER.info("HELLO from Register Effect");
            effectRegistryEvent.getRegistry().registerAll(
                    PotionList.biaseffect = new PotionList.BiasEffect(EffectType.BENEFICIAL, 14981690)
                    .setRegistryName(new ResourceLocation(MOD_ID, "bias_effect"))
            );
        }

 

↓Effect Class(PotionList)↓

public static class BiasEffect extends Effect {

        @Override
        public void performEffect(LivingEntity entityLivingBaseIn, int amplifier) {
            super.performEffect(entityLivingBaseIn, amplifier);

            LOGGER.info("yes");
        }

        public BiasEffect(EffectType typeIn, int liquidColorIn){
            super(typeIn, liquidColorIn);
        }
    }

 

Link to post
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.

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.



×
×
  • Create New...

Important Information

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