Solved Need Help for Anticheat

Discussion in 'Plugin Development' started by aweewee, Jan 11, 2020.

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

    aweewee

    I'm coding an anticheat. For my speed check, I made the max speed 0.50D. This flags all speeds on sigma(my test client), but it also flags when 1)someone has speed potion effect, 2) when someone is flying in creative mode, 3) when soemone is on ice. Can someone teach me how to make it not flag for these things?
     
    Last edited: Jan 11, 2020
  2. Offline

    KarimAKL

    @aweewee Make checks for those.
    1. Check if the player has the speed effect, and then check the speed effect's amplifier.
    2. Check if they're flying with Player#isFlying(), and then apply the speed bonus from Player#getFlySpeed()
    3. You can check if the block below them is ice with this:
    Code:Java
    1. Material type = player.getLocation().getBlock().getRelative(BlockFace.DOWN).getType();
    2. if (type == Material.ICE) {
    3. // The block below them is of type ICE
    4. }

    You might have to make another check, in case they jump with the speed bonus from ice.
     
    Sw_aG likes this.
  3. Offline

    aweewee

    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page