Player´s knockback help

Discussion in 'Plugin Development' started by MrDandS97, Feb 6, 2017.

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

    MrDandS97

    Hey,
    I know you can get player´s knockback with the getVelocity() method in PlayerVelocityEvent class, but I was wondering if a player is using cheats (reducing his knockback), will the getVelocity() method return 0?
    Thanks
     
  2. Offline

    Zombie_Striker

    @MrDandS97
    Based on packets, clients have no control over their velocity. So, no, it should not be 0.
     
  3. Offline

    fireboyev

    You would probably have to wait about 3-5 ticks and then check their velocity using Player#getVelocity()
     
  4. Offline

    Disgastings

    You could check wether the player is hacking , and then teleport him back at his last positions.
     
  5. Offline

    Zombie_Striker

    @Disgastings
    How would he check if the player is hacking?

    @fireboyev
    Most likely that will not fix the issue. Unless the player somehow modifies the velocity after they have already been hit (which is unlikely), this would not do anything except produce false positives if the player is against a wall, is falling, or tries to move in any other direction.
     
    Rayzr522 likes this.
Thread Status:
Not open for further replies.

Share This Page