package me.km.effects.active; import me.km.KajetansMod; import me.km.api.Utils; import me.km.effects.ActiveEffectBase; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.DamageSource; public class LifeSteal extends ActiveEffectBase { @Override protected boolean executeEffect(EntityPlayerMP p, int power) { EntityLivingBase liv = Utils.getTargetedEntity(p, 6, EntityLivingBase.class); if(liv == null) { return false; } DamageSource ds = DamageSource.causeMobDamage(p); float real = Utils.getRealDamage(liv, ds, power); liv.attackEntityFrom(ds, power); p.heal(real); if(liv instanceof EntityPlayerMP) { KajetansMod.playerbank.getData((EntityPlayerMP) liv) .addBadTimedData("lessheal", true, 100, " - 50% Heilung", 63); } return true; } }