Posted February 15, 201411 yr I'm trying to make my food apply multiple potion effects to the player, But it is only applying the first one? I read that there's an issue that causes it to only apply the potion effect if it's the first modifier, so Is there a way around it? public static Item Food = new Food(5011, 6, 0.8f, false).setPotionEffect(Potion.moveSlowdown.id, 2, 10, 100).setPotionEffect(Potion.hunger.id, 2, 10, 100).setCreativeTab(CreativeTabs.tabFood).setUnlocalizedName("Food").setTextureName(BasicInfo.NAME + ":Food");
February 15, 201411 yr Try adding an onFoodEaten method. public ItemStack onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par3EntityPlayer.addPotionEffect((new PotionEffect(Potion.nightVision.getId(), 100, 0))); par3EntityPlayer.addPotionEffect((new PotionEffect(Potion.wither.getId(), 100, 0))); }
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.