package gerhard2202.culinaromancy.item;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;

import java.util.Random;

public class ItemGourmetChicken extends ItemCulinaromancyFood
{
    public ItemGourmetChicken() {
        super("gourmetChicken", 7, 8.2F, false);
    }

    @Override
    public int getMaxItemUseDuration(ItemStack stack)
    {
        return 32;
    }

    @Override
    public void onFoodEaten(ItemStack stack, World worldIn, EntityPlayer player)
    {
        Random buffChance = new Random();
        int result = buffChance.nextInt(100) + 1;
        if (result <= 50) {
            player.addPotionEffect(new PotionEffect(MobEffects.SPEED, 1600, 0, false, false));
        }
    }
}
