In Depth Fly Hacking Detection

Discussion in 'Plugin Development' started by Agentleader1, Mar 13, 2015.

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

    Agentleader1

    Somewhat like Mineplex, I want the ability to kick people when their velocity is too high for the server to be able to set that. Usually when you fly hack, the speed is very great, often confused with Speed hacks, which currently do not exist, just fly hacks on the ground super fast. I'm just wondering How to detect when someone's velocities are too high and matches flying.

    I have tried to detect PlayerMoveEvent, and check for the velocity of the player, and I've also tried to detect the velocity of the Player in PlayerVelocityEvent as well. None of them worked.

    Code:
    @EventHandler
    public void onMove(PlayerMoveEvent pme){
        Player player = pme.getPlayer();
        if(player.getVelocity().getX() > 2 ||
                player.getVelocity().getY > 2 ||
                player.getVelocity().getZ > 2){
            player.kickPlayer(blah blah);
            //blah blah blah
        }
    }
    
    @EventHandler
    public void onVelocity(PlayerVelocityEvent pve){
        Player player = pve.getPlayer();
        if(pve.getVelocity().getX() > 2 ||
                pve.getVelocity().getY > 2 ||
                pve.getVelocity().getZ > 2){
            player.kickPlayer(blah blah);
            //blah blah blah
        }
    }
    How do I detect fly hacking according to vectors?
     
  2. Offline

    Konato_K

    @Agentleader1 You can't just detect fly hacking, you need to keep a track on how they are moving and all that stuff.

    What's wrong with using an already made anti-cheat plugin?
     
  3. Offline

    Agentleader1

    Block teleportation and reliability.

    //Edit: Also should mention, I need to be able to change it with ease, because I have stuff like rocket launchers that set their velocities so high, NoCheatPlus, or other plugins, will block it, or kick them. So yea
     
  4. Offline

    Konato_K

    @Agentleader1 If you configure NCP properly you won't get any troubles, of course, the detection will also be more loose, but that will happen with any anti-cheat
     
  5. Offline

    Agentleader1

    Reliability, key word here.

    //Edit: I also should mention that Double Jump is something I have
     
  6. Offline

    Konato_K

    @Agentleader1 NCP still works for that.

    Anyway, if you think an anti-cheater that has been there for a long time will work worse than one you can make with no idea of how to check flying then good luck.

    Also, I don't mean this in an offensive way, you'll need to keep a track of how the player is moving, when, and where.

    Try using getFrom and getTo on PlayerMove?
     
  7. Offline

    Agentleader1

    Alright, so the getFrom and getTo, should I see if the distance is larger than what? Or some other method? And what should the "What" distance be for it to be a flying movement?
     
  8. Offline

    Konato_K

    @Agentleader1 I'm not sure, but if they are not on ground I'll assume they are flying, or jumping, in the case they are jumping then they should probably change their Y and other stuff.
     
Thread Status:
Not open for further replies.

Share This Page