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

Teleport player when he falls

Discussion in 'Development' started by gistrec, Feb 3, 2017.

  1. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    I would like to teleport player, when he falls.
    My code:
    PHP:
    public function onFall(EntityDamageEvent $event){ 
            if (
    $event->getEntity() instanceof Player && $event->getCause() == 4) {
                    
    $event->setCancelled();
                    
    $event->getEntity()->teleport(new Vector3($this->x$this->y$this->z));
            }
    }
    But when event is triggered and player teleported, I see repeating message in the console:
    [Server thread/WARNING]: player moved too fast, reverting movement
    And player can't move - him return back to teleport position
    Why? :c
     
  2. kaliiks

    kaliiks Zombie

    Messages:
    250
    Dont use Tesseract :-D
     
  3. gistrec

    gistrec Witch

    Messages:
    68
    GitHub:
    gistrec
    I don't use "Tesseract"
    I tested on pmmp/genisys
     
  4. kaliiks

    kaliiks Zombie

    Messages:
    250
    So, check Player height and teleport teleport when it was low
     
  5. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    The reverting movement thing has to do with Anti-Cheat built in. If I'm correct @dktapps has been working on it, and (correct me if I'm wrong) you can disable movement check in pocketmine.yml to 'fix' it.
     
    gistrec likes this.
  6. kaliiks

    kaliiks Zombie

    Messages:
    250
    In pocketmine is it fixed download newest version
     
  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.