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

Solved Error SetBounds

Discussion in 'Development' started by Palente, Jan 19, 2018.

  1. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Code:
    15:46:46] [Server thread/INFO]: Palente[/37.lol.139.xx:29040] s'est connecté avec l'ID d'entité 1 à (Spawn, -1794.0964, 74.001, -358.7918)
    [15:46:58] [Server thread/CRITICAL]: Commande d'exécution d'exception non gérée 'home b' dans home: Argument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type float, string given, called in phar:///root/Tested/PocketMine-MP.phar/src/pocketmine/entity/Entity.php on line 1696                          [15:46:58] [Server thread/CRITICAL]: TypeError: "Argument 2 passed to pocketmine\math\AxisAlignedBB::setBounds() must be of the type float, string given, called in phar:///root/Tested/PocketMine-MP.phar/src/pocketmine/entity/Entity.php on line 1696" (EXCEPTION) in "src/pocketmine/math/AxisAlignedBB" at line 52              [15:46:58] [Server thread/DEBUG]: #0 src/pocketmine/entity/Entity(1696): pocketmine\math\AxisAlignedBB->setBounds(double -1757.3, string 79, double -340.3, double -1756.7, double 80.8, double -339.7)
    [15:46:58] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(1712): pocketmine\entity\Entity->setPosition(pocketmine\level\Position object)
    [15:46:58] [Server thread/DEBUG]: #2 src/pocketmine/entity/Entity(1805): pocketmine\entity\Entity->setPositionAndRotation(pocketmine\level\Position object, double 183, double 7)
    [15:46:58] [Server thread/DEBUG]: #3 src/pocketmine/Player(3653): pocketmine\entity\Entity->teleport(pocketmine\level\Position object, NULL , NULL )
    [15:46:58] [Server thread/DEBUG]: #4 Faction+/src/Palente/Factionplus/Commands/Home(60): pocketmine\Player->teleport(pocketmine\level\Position object)
    Causing by teleport a player to a new Position
    PHP:
    $sender->teleport(new Position($x$y$z$level));
     
  2. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    Please show us your entire function. Especially the part where you define $x, $y and $z.
     
  3. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Okay
    PHP:
    $all explode("_",$homes->get($args[0]));
                
    $x $all[1];
                
    $y $all[2];
                
    $z $all[3];
                
    $level $sr->getLevelByName($all[4]);
                if(!
    $level instanceof Level){
                    
    $sender->sendMessage(TX::RED."[Faction +]Home: Oups Il semblerait Que cette home ne soit accessible pour le moment!");
                    return 
    false;
                    }
                    
    $sender->teleport(new Position($x$y$z$level));
    $homes is the config
    Like that
    b: b_-1757_79_-340_Spawn
     
  4. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    sorry for the bump but i need to know how to resolve it so.....
     
  5. Kenn Fatt

    Kenn Fatt Slime

    Messages:
    82
    GitHub:
    kennfatt
    You should cast those $x, $y, and $z as float.

    PHP:
    $x = (float) $all[1];
    // Do same thing with y and z
     
  6. Oniii-Chan

    Oniii-Chan Witch

    Messages:
    66
    GitHub:
    Vincent583
    #TeamFrance.Je suis français :p
     
    Palente and armagadon159753 like this.
  7. Palente

    Palente Slime

    Messages:
    75
    GitHub:
    palente
    Thanks Man That Work
     
  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.