public void attackEntity(DamageType type, float amount)
    {
        if(onAttack(type, amount) && hurtTime <= 0)
        {
            life-=amount*(1f/this.getArmorMultiplier());
            hurtTime = 20;
            if(life <= 0.f && onDeath(type, amount))
            {
                alive = false;
                this.die();
            }
            if(life > getMaxLife())
                life = getMaxLife();
        }
    }