Exemple #1
0
        public override ItemStack OnFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
        {
            par1ItemStack.StackSize--;
            par3EntityPlayer.GetFoodStats().AddStats(this);
            par2World.PlaySoundAtEntity(par3EntityPlayer, "random.burp", 0.5F, par2World.Rand.NextFloat() * 0.1F + 0.9F);

            if (!par2World.IsRemote && PotionId > 0 && par2World.Rand.NextFloat() < PotionEffectProbability)
            {
                par3EntityPlayer.AddPotionEffect(new PotionEffect(PotionId, PotionDuration * 20, PotionAmplifier));
            }

            return(par1ItemStack);
        }