Solved Critical Hits

Discussion in 'Plugin Development' started by dlange, Oct 2, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    dlange

    How would you detect if a hit is critical? I know that you can use velocity but hacked clients (i am making an anticheat) don't seem to do the little jumps they used to when doing a crit.
    I know there is a way with NMS but i'm not really sure on what it is.
     
  2. Offline

    567legodude

    @dlange You can check to see if the damage dealt is greater than normal, meaning critical, then just check to see if their Y velocity is negative to see if they were supposed to deal a critical.
     
  3. Offline

    dlange

    @567legodude Oh yeah that should work haha don't know how i didn't think about that XD

    Thanks a lot man :D

    EDIT: JUST realised that i will have to add checks for every combination of every armour type. Very inefficient imo, if anyone else has other ideas, let me know :p
     
  4. Offline

    567legodude

    @dlange The EntityDamageByEntityEvent should have a method to get the amount of damage dealt before accounting for enchantments/armor (I believe). All you really need to check for is the type of weapon they are holding.

    EDIT: Should be event.getDamage() to get damage before any reduction is applied.
     
  5. Offline

    dlange

    @567legodude Alright cheers, ill look into it :D

    EDIT: Sweet, i found a way implementing that :D
    Thanks a lot!
     
    Last edited: Oct 3, 2015
Thread Status:
Not open for further replies.

Share This Page