Solved Critical hits + detection

Discussion in 'Spigot Plugin Development' started by davidcubesvk, Feb 20, 2019.

Thread Status:
Not open for further replies.
  1. Hello,

    I searched around Google, but I just want to be sure at 100% what requirements for critical hits are.
    Q1: What are the requirements for critical hit? (what exactly critical hit is?)

    Next, I want to ask, what exactly critical hacks do.
    Q2: What does critical hack do?

    And finally, how to detect them?
    Q3: How to detect them?

    Thanks to everyone for help!
     
  2. from what i remember, you have to be falling, critical hits just deal more damage, and i'm not sure
     
  3. MiniDigger

    Supporter

    • Winner Winner x 1
  4. MiniDigger

    Supporter

    why tho if ppl done that before and documented it on a public wiki?
     
  5. I'm prettty sure that critical hacks make victim taking criticals hit without jumping, you can detect it with position of player
     
  6. Yea, i know, one just gives you the almost exact code mojang uses, then you just figure out how to replicate it
     
  7. also with any amount of googling, i found this https://www.spigotmc.org/threads/how-to-catch-critical-hits.221616/

    and this code

    Code (Text):

    private boolean isCritical(Player player)
        {
            return
                    player.getFallDistance() > 0.0F &&
                    !player.isOnGround() &&
                    !player.isInsideVehicle() &&
                    !player.hasPotionEffect(PotionEffectType.BLINDNESS) &&
                    player.getLocation().getBlock().getType() != Material.LADDER &&
                    player.getLocation().getBlock().getType() != Material.VINE;
        }
     
    if you want to take into account "A base attack must not be reduced to 84.8% damage or lower due to cooldown.‌"
    That will probably be a bit difficult, if you want the exact code they use for that, you'll have to check MCP code net.minecraft.entity.player.EntityPlayer
     
  8. Also, you can detect it with timer detection
     
  9. How would this be useful exactly?
     
  10. Thanks to everyone! Yeah, I want to ask, what means this:
    ,,A base attack must not be reduced to 84.8% damage or lower due to cooldown.‌‌"

    And finally, what critical hacks do?
     
  11. critical hacks pretty much just give you critical hits EVEN if you don't meet the requirements to get a critical hit
     
  12. Ok, so I will check if the hit is critical, if it is, check the requirements and if player doesn't meet with all of them, then it's hacking?

    And how can I calculate that 150% of unenchanted weapon damage without armor (as on wiki)? Is there any efficient way?
     
  13. MiniDigger

    Supporter

    I would assume they just fake fall distance to always make you appear falling.
    well, if you spam click (click faster than the attack cooldown than your weapon), your base attack damage get lowered. as you can check the attack cooldown of the current weapon and go from there.
    honestly, thats all way to complicated tho, I would assume that crit hacks are rather simple.
     
  14. Yes, I understand, but if yes, how else can I check if they fall?

    Base attack damage from weapon which player attacks with, not in cooldown?
     
  15. Maybe i'll get around to re-creating the exact code mojang uses, but for spigot instead *shrug* i planned to look through the source code anyways for private projects
     
  16. critical hack just sends fall distance packet of very low number (like 0.07234567432) also a lot of hacked clients use one same number of fall distance for critical hack, so if you just check exact number based on their client code, you can detect it very easily xD but that can be easily bypassed, what I do is just make hits not critical (reduce damage) if they come from very low fall distance(below 0.1) doesn't really disturb gameplay
     
  17. Yes, that will be probably the best way... BTW, where can I find this code? :)

    Are you sure?
     
  18. Use ModCoderPack, then the code is in net.minecraft.entity.player.EntityPlayer
     
  19. Yes, thank you! I will look at that!

    And, I want to ask probably last thing:
     
Thread Status:
Not open for further replies.

Share This Page