Hey, i have a problem. I wrote a plugin which teleports the player back, if he jumps from something down and get fall damage. So the problem is, its not working. For a short time the player will be teleport to his old location who he jumps down, but than I get a warning in the console ("PlayerXYZ moved wrongly!") and the player will be teleport to the location, who he got fall damage. Sometimes I dont get the warning-message.. Does anyone know why? Thanks!
Yes, sorry: PHP: public function onDamage(EntityDamageEvent $event) { if ($event->getCause() == EntityDamageEvent::CAUSE_FALL) { $player = $event->getEntity (); if ($player instanceof Player) { $player->teleport ( new Vector3 ( 143.5, 109, 155.5 ) ); $player->sendPopup ( TextFormat::BOLD . TextFormat::RED . "Du bist gestorben!" . TextFormat::RESET ); } } $event->setCancelled();}
@Ozelord I suspect that it doesn't work, because the pocketmine version is not stable yet. I have also tried it with teleportation via Console(dispatchCommand()), setPosition() and getSafeSpawn() - The problem still the same
There are a whole variety of issues related to movement and teleportation at the moment, most of them due to bad anti-cheat, ranging from death/respawn not working properly, freezes/memleaks when teleporting, getting TPed down ladders, etc.. It's probably going to need a full rewrite to remove all the crap.