Hi all I would like to create function, witch teleport player to spawn, when he fall Spoiler: My code PHP: public function PlayerFallEvent(EntityDamageEvent $event){ if($event->getEntity()->getLevel()->getName() == self::LOBBY_NAME){ if ($event->getEntity() instanceof Player && $event->getCause() == 4) { $event->setCancelled(); $event->getEntity()->teleport(new Vector3(self::X, self::Y, self::Z)); } }} But sometimes, than this event is happens, server start spam in console error message (very-very fast spam) Spoiler: Error Code: [Server thread/DEBUG]: BatchPacket 0x78da1396123fdaf4c1898141c5298bbdd989f11f0b0303ab2a83f13a4711290e649979602919110690e0c32a2db0e07b057747decc358740988111af2400984722a1 [Server thread/CRITICAL]: TypeError: "Argument 1 passed to pocketmine\Player::sendPosition() must be an instance of pocketmine\math\Vector3, null given, called in src/pocketmine/Player.php on line 2239" (EXCEPTION) in "src/pocketmine/Player" at line 3917 [Server thread/DEBUG]: #0 /src/pocketmine/network/Network(253): pocketmine\Player->handleDataPacket(pocketmine\network\protocol\MovePlayerPacket object) [Server thread/DEBUG]: #1 /src/pocketmine/Player(2099): pocketmine\network\Network->processBatch(pocketmine\network\protocol\BatchPacket object, pocketmine\Player Player(1)) [Server thread/DEBUG]: #2 /src/pocketmine/network/RakLibInterface(139): pocketmine\Player->handleDataPacket(pocketmine\network\protocol\BatchPacket object) [Server thread/DEBUG]: #3 /src/raklib/server/ServerHandler__64bit(94): pocketmine\network\RakLibInterface->handleEncapsulated(string 91.202.71.251:50887, raklib\protocol\EncapsulatedPacket `.(e..a.....Bx....?.....A.)..........*..:G.).d.y`)......*-..{.wG..5.@....$..G"., integer 0) [Server thread/DEBUG]: #4 /src/pocketmine/network/RakLibInterface(74): raklib\server\ServerHandler->handlePacket(boolean) [Server thread/DEBUG]: #5 /src/pocketmine/network/Network(156): pocketmine\network\RakLibInterface->process(boolean) [Server thread/DEBUG]: #6 /src/pocketmine/Server(2644): pocketmine\network\Network->processInterfaces(boolean) [Server thread/DEBUG]: #7 /src/pocketmine/Server(2378): pocketmine\Server->tick(boolean) [Server thread/DEBUG]: #8 /src/pocketmine/Server(2256): pocketmine\Server->tickProcessor(boolean) [Server thread/DEBUG]: #9 /src/pocketmine/Server(1860): pocketmine\Server->start(boolean) [Server thread/DEBUG]: #10 /src/pocketmine/PocketMine(479): pocketmine\Server->__construct(pocketmine\CompatibleClassLoader object, pocketmine\utils\MainLogger object, string /home/server/mcpeServer/, string /home/server/mcpeServer/, string /home/server/mcpeServer/plugins/) I try a lot of way to solve this problem: update pmmp, editing Player.php and so on... But I found one solution: I use callback in my function, witch teleport Player after 1 tick Spoiler: My changes PHP: // I change$event->getEntity()->teleport(new Vector3(self::X, self::Y, self::Z));// To$this->getServer()->getScheduler()->scheduleDelayedTask(new CallbackTask([$event->getEntity(),"teleport"], [new Vector3(self::X, self::Y, self::Z)]), 1); But now, player normally teleport, but server write 1 error message: Spoiler: New error msg Code: Notice: Object of class pocketmine\scheduler\CallbackTask could not be converted to float in src/pocketmine/utils/Binary.php on line 388 Very nice, in 388 line I have function Spoiler: Function 388 line Binary.php PHP: public static function writeLFloat($value){ return ENDIANNESS === self::BIG_ENDIAN ? strrev(pack("f", $value)) : pack("f", $value);} I var dump'ed $value, when server write error msg Spoiler: var_dump $value [90 lines!!!] Code: object(pocketmine\scheduler\CallbackTask)#18210 (3) { ["callable":protected]=> array(2) { [0]=> object(pocketmine\Player)#11669 (0) { } [1]=> string(8) "teleport" } ["args":protected]=> array(2) { [0]=> object(pocketmine\math\Vector3)#18215 (3) { ["x"]=> float(55.5) ["y"]=> int(55) ["z"]=> float(62.5) } [1]=> *RECURSION* } ["taskHandler":"pocketmine\scheduler\Task":private]=> object(pocketmine\scheduler\TaskHandler)#18217 (8) { ["task":protected]=> *RECURSION* ["taskId":protected]=> int(105) ["delay":protected]=> int(1) ["period":protected]=> int(-1) ["nextRun":protected]=> int(193) ["cancelled":protected]=> bool(false) ["timings"]=> object(pocketmine\event\TimingsHandler)#18218 (9) { ["name":"pocketmine\event\TimingsHandler":private]=> string(67) "Task: Scheduler Runnable: pocketmine\scheduler\CallbackTask(Single)" ["parent":"pocketmine\event\TimingsHandler":private]=> object(pocketmine\event\TimingsHandler)#141 (9) { ["name":"pocketmine\event\TimingsHandler":private]=> string(25) "** Scheduler - Sync Tasks" ["parent":"pocketmine\event\TimingsHandler":private]=> NULL ["count":"pocketmine\event\TimingsHandler":private]=> int(0) ["curCount":"pocketmine\event\TimingsHandler":private]=> int(0) ["start":"pocketmine\event\TimingsHandler":private]=> int(0) ["timingDepth":"pocketmine\event\TimingsHandler":private]=> int(0) ["totalTime":"pocketmine\event\TimingsHandler":private]=> int(0) ["curTickTotal":"pocketmine\event\TimingsHandler":private]=> int(0) ["violations":"pocketmine\event\TimingsHandler":private]=> int(0) } ["count":"pocketmine\event\TimingsHandler":private]=> int(0) ["curCount":"pocketmine\event\TimingsHandler":private]=> int(0) ["start":"pocketmine\event\TimingsHandler":private]=> int(0) ["timingDepth":"pocketmine\event\TimingsHandler":private]=> int(0) ["totalTime":"pocketmine\event\TimingsHandler":private]=> int(0) ["curTickTotal":"pocketmine\event\TimingsHandler":private]=> int(0) ["violations":"pocketmine\event\TimingsHandler":private]=> int(0) } ["timingName"]=> string(33) "pocketmine\scheduler\CallbackTask" } } And can you help?) How can I normally teleport my player when he fall
You are not using pmmp. pocketmine\scheduler\CallbackTask does not exist anymore. You're not supposed to be using it. And i doubt that the error happens if you'd happen to use pmmp.
This is exactly why you should fork projects, NOT 'spoon' them, so you can merge changes to PMMP into your own fork. You could start afresh by forking PMMP and integrating your own changes back into the fork.