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

Solved Why receiving this error while teleporting on PlayerRespawn?

Discussion in 'Help' started by LewBr, Apr 13, 2018.

  1. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Hello, i am receiving a error like this:
    PHP:
    13.04 11:41:40 [ServerServer thread/CRITICAL Could not pass event 'pocketmine\event\player\PlayerRespawnEvent' to 'LeoHarduCore v4'Argument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type floatstring givencalled in phar:///custom7.2.phar/src/pocketmine/entity/Entity.php on line 640 on leohardu\EventosListener 13.04 11:41:40 [Server] Server thread/CRITICAL TypeError: "Argument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type float, string given, called in phar:///custom7.2.phar/src/pocketmine/entity/Entity.php on line 640" (EXCEPTION) in "vendor/pocketmine/math/src/AxisAlignedBB" at line 50 13.04 11:41:40 [Server] Server thread/DEBUG #0 src/pocketmine/entity/Entity(640): pocketmine\math\AxisAlignedBB->setBounds(double 68.2, string 80, double 1.2, double 68.8, double 81.8, double 1.8) 13.04 11:41:40 [Server] Server thread/DEBUG #1 src/pocketmine/entity/Entity(1756): pocketmine\entity\Entity->recalculateBoundingBox() 13.04 11:41:40 [Server] Server thread/DEBUG #2 src/pocketmine/entity/Entity(1772): pocketmine\entity\Entity->setPosition(pocketmine\level\Position object) 13.04 11:41:40 [Server] Server thread/DEBUG #3 src/pocketmine/entity/Entity(1867): pocketmine\entity\Entity->setPositionAndRotation(pocketmine\level\Position object, double 9.9500427246094, double 0)
    that's the code:
    PHP:
    onPlayerRespawnEvent{
    $player $event->getPlayer();
                    
    $player->teleport(new \pocketmine\math\Vector3(33370333, \pocketmine\Server::getInstance()->getLevelByName("level")));

    }
     
  2. HBIDamian

    HBIDamian HBIDamian Staff Member

    Messages:
    365
    GitHub:
    HBIDamian
    Ouch, that formatting
     
  3. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    what?
     
  4. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    I know it, it was a problem with my config who was the x, y, z coords i forget to set (int) on them, solved.
     
  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.