Jump to content

New Food Effect Method Syntax


skip999

Recommended Posts

Hello,

I have been working on a mod that adds a new food item as part of its content. The food gives effects, and I have listed the part of the code that does this:

 

                        //Absorption: 10 hearts for 10 seconds
                        .effect(new EffectInstance(Effects.ABSORPTION, 200, 10), 1f)
                        //Resistance: Resistance X for 10 seconds
                        .effect(new EffectInstance(Effects.RESISTANCE, 200, 10), 1f)
                        //Regeneration: Regeneration V for 10 seconds
                        .effect(new EffectInstance(Effects.REGENERATION, 200, 4), 1f)
                        //Wither: Wither II for 18 seconds
                        .effect(new EffectInstance(Effects.WITHER, 380, 2), 1f)

 

However, eclipse is registering this as a deprecated method. I would like to do things the new and correct way, so if someone could point me to the new way of declaring an effect with custom duration for a food, I would appreciate it.

Here is a link to the project on GitHub if you need more clarification on the code: https://github.com/skiprocks999/Amulets-of-Infinity/tree/Item-Library/ContInfItemLib

 

Thanks in advance!

 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.