Posted December 5, 201410 yr I have been following a youtube tutorial on how to make food with potion effects. However I cant get more than one to work at a time. Here is my code; public class MirakuruClass extends ItemFood{ public MirakuruClass(int hunger, float saturation, boolean IsWolfFood) { super(hunger, saturation, IsWolfFood); this.setPotionEffect(Potion.regeneration.id, 1800, 10, 1.0f); } protected void onfoodEaten(ItemStack itemstack, World world, EntityPlayer player){ player.addPotionEffect(new PotionEffect(Potion.resistance.id, 1800, 10)); player.addPotionEffect(new PotionEffect(Potion.damageBoost.id, 1800, 10)); }}
December 5, 201410 yr Author I have another question. When I eat the food I only get the potion effects for 1:30min. Can I make it longer?
December 5, 201410 yr player.addPotionEffect(new PotionEffect(Potion.resistance.id, 1800, 10));//parameters: potion effect, duration, strength Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.