Skip to content

Commit

Permalink
missed attack cooldown factor for was_critical
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 28, 2021
1 parent 4943158 commit 8cd5adb
Showing 1 changed file with 4 additions and 0 deletions.
@@ -1,5 +1,6 @@
package com.denizenscript.denizen.events.entity;

import com.denizenscript.denizen.nms.NMSHandler;
import com.denizenscript.denizen.objects.EntityTag;
import com.denizenscript.denizen.objects.ItemTag;
import com.denizenscript.denizen.utilities.implementation.BukkitScriptEntryData;
Expand Down Expand Up @@ -188,6 +189,9 @@ public boolean calculateWasCritical() {
return false;
}
Player player = damager.getPlayer();
if (NMSHandler.getPlayerHelper().getAttackCooldownPercent(player) < 0.999) { // attack cooldown is also checked in that method earlier
return false;
}
if (player.getFallDistance() <= 0 || player.isOnGround() || player.isClimbing() || player.isInWater()) {
return false;
}
Expand Down

0 comments on commit 8cd5adb

Please sign in to comment.