public static float calcAttackSpeedMod(EntityLivingBase entity) { int ticks = StatsUtil.getAttackTimer(entity); float scale = MathHelper.clamp_float((ticks + 0.5F) / getAttackCooldown(entity), 0.0F, 1.0F); return 0.2F + scale * scale * 0.8F; }