package net.Chipperfluff.chipi.effect;

import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectCategory;

public class ChipiBlessingEffect extends StatusEffect {

    public ChipiBlessingEffect() {
        super(StatusEffectCategory.BENEFICIAL, 0xFF8000);
    }

    @Override
    public boolean canApplyUpdateEffect(int duration, int amplifier) {
        return true; // run every tick
    }

    @Override
    public void applyUpdateEffect(LivingEntity entity, int amplifier) {
        if (entity.getHealth() < entity.getMaxHealth()) {
            entity.heal(0.05f * (amplifier + 1));
        }
    }
}
