package me.km.items;

import net.minecraft.entity.LivingEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;

public abstract class ItemFood extends Item {
    public ItemFood(Properties properties) {
        super(properties);
    }

    @Override
    public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity liv) {
        if(this.isFood()) {
            onFoodEaten(stack, worldIn, liv);
            return liv.onFoodEaten(worldIn, stack);
        }
        return stack;
    }

    public abstract void onFoodEaten(ItemStack stack, World worldIn, LivingEntity liv);
}
