1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Catch HighJump

Discussion in 'Facepalm' started by Driesboy, Aug 10, 2017.

  1. Driesboy

    Driesboy Spider Jockey

    Messages:
    34
    GitHub:
    driesboy
    Hello, Since a few months i have some jump hackers in our server
    How to catch them by code?
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Side note: Make sure you don't accidentally detect people jumping into water pillars.
     
    jasonwynn10 likes this.
  3. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    You can check if position Y where player get to is higher than position where player get from. Example: (I do not have tested)
    PHP:
    public function onMove(PlayerMoveEvent $e){
       
    $p $e->getPlayer();
       
    $f $e->getFrom();
       
    $t $e->getTo();
       
    $d $f->distance($t);
       if(
    $t $f){
          if(
    $d >= 3){
           if(!
    $p->hasEffect(Effect::JUMP_BOOST)){
                 
    $p->kick("High jump"false);
               }
           }
       }
    EDIT: This code may cause some problems, when player is knockbacked
     
  4. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    momentum?
    since like if you swim up water pillar you would have momentum lower than you just got thrown into the air then fall back
    also using onMove is not preferred
     
  5. Driesboy

    Driesboy Spider Jockey

    Messages:
    34
    GitHub:
    driesboy
  6. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    Even with high jump you don't necessarily rise for 3 blocks immediately in a single tick.
     
  7. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    There is nothing wrong with onMove if you are using it to capture precise movement like this context.
     
  8. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
  9. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
  10. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    And a mod can prevent this event from firing.
     
  11. Teamblocket

    Teamblocket Zombie

    Messages:
    301
    GitHub:
    teamblocket
    :(
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.