Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.6.1] How to add "performEffect" to my custom potion effect?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
raddeee

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

By raddeee, August 15, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

raddeee    0

raddeee

raddeee    0

  • Tree Puncher
  • raddeee
  • Members
  • 0
  • 1 post
Posted August 15, 2020

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

 

  • Quote

Share this post


Link to post
Share on other sites

Novârch    31

Novârch

Novârch    31

  • Diamond Finder
  • Novârch
  • Members
  • 31
  • 422 posts
Posted August 15, 2020

performEffect only runs if isReady returns true.

  • Quote

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Share this post


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.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • SixSix
      I need help to learn

      By SixSix · Posted 9 minutes ago

      ¿Cómo puedo aprender a codificar para hacer mods? Llevo días preguntandome como poder hacerlo, aunque existan opciones faciles como mcreator. No me convence, puesto que quitaron los modelos .java del geckolib en blockbench y decidí buscar cursos de java, pero no sé que especificamente por donde empezar o si quiera si me servirán.
    • chuckdie5el
      Server Console errors

      By chuckdie5el · Posted 26 minutes ago

      the file is 22.8 mb. would you just like for me to take a portion of it?
    • iiDk_lol
      Help using Minecraft Forge on Manjaro Linux

      By iiDk_lol · Posted 28 minutes ago

      Go to downloads and select other versions.
    • iiDk_lol
      Any places for support with 1.8

      By iiDk_lol · Posted 33 minutes ago

      I am trying to create a forge 1.8 server but I can't find any support website.
    • metword
      [1.16.4] Config file will not update.

      By metword · Posted 43 minutes ago

      Does anyone know how to fix my problem?   thanks, metword
  • Topics

    • SixSix
      0
      I need help to learn

      By SixSix
      Started 9 minutes ago

    • chuckdie5el
      2
      Server Console errors

      By chuckdie5el
      Started 3 hours ago

    • gibbyj
      2
      Help using Minecraft Forge on Manjaro Linux

      By gibbyj
      Started 1 hour ago

    • iiDk_lol
      0
      Any places for support with 1.8

      By iiDk_lol
      Started 33 minutes ago

    • metword
      9
      [1.16.4] Config file will not update.

      By metword
      Started Wednesday at 04:20 PM

  • Who's Online (See full list)

    • monkeysHK
    • zombiefighters0
    • chuckdie5el
    • FrostyTerror
    • MKMalloy
    • Forix
    • SixSix
    • thorstenschwager
    • jackcat1423
    • Sleepwalkerx
    • Heinzchen
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.6.1] How to add "performEffect" to my custom potion effect?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community