package com.zivilon.cinder_loe.util;

import net.minecraft.entity.EntityLivingBase;
import net.minecraftforge.event.entity.living.LivingHurtEvent;

public class RangedDamageUtil {
    public static void applyExtraDamage(LivingHurtEvent event, float multiplier) {
        EntityLivingBase target = event.entityLiving;
        float base = event.ammount;
        float extra = base * multiplier;
        float currentHealth = target.getHealth();
        if (currentHealth > extra) {
            target.setHealth(currentHealth - extra);
            event.setCanceled(true);
        } else {
            event.ammount = currentHealth;
        }
    }
}


