Posted June 5, 20205 yr 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!
June 6, 20205 yr // Forge: Use supplier method instead the comment above the deprecated Food.Builder.effect, basically telling you to use the above one
June 6, 20205 yr Author Took me a sec to figure out what you meant but I think I got it. It works so Ill call it fixed. Thanks for the help! Edited June 6, 20205 yr by skip999
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.