Last active
March 2, 2016 21:10
-
-
Save System-Glitch/d7f08c0cf5645d2ef923 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This code allows you to know if the player is critical hitting | |
//This has to be used in EntityDamageByEntityEvent | |
//"p" is the Player variable | |
boolean crit = ((CraftPlayer) p).getHandle().fallDistance > 0.0F && !((CraftPlayer) p).getHandle().onGround && !((CraftPlayer) p).getHandle().n_() && !((CraftPlayer) p).getHandle().isInWater() && !((CraftPlayer) p).getHandle().hasEffect(MobEffects.BLINDNESS) && !((CraftPlayer) p).getHandle().isPassenger(); | |
crit = crit && !((CraftPlayer) p).getHandle().isSprinting(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment