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

Solved "new Position" requiring a Class

Discussion in 'Development' started by Clik, May 27, 2019.

  1. Clik

    Clik Spider Jockey

    Messages:
    25
    GitHub:
    KadTheHunter
    I have a plugin i made to teleport players to coordinates written into the code. From what i can tell, it teleports you there fine, but thats useless because it crashes you with an Internal Server Error, and this:
    Code:
    2019-05-27 [00:03:16] [Server thread/CRITICAL]: Error: "Class 'Clik\HogwartsWarps\Position' not found" (EXCEPTION) in "plugins/HogwartsWarps_dev-7.phar/src/Clik/HogwartsWarps/Main" at line 18
    
    Lines 12-20:
    Code:
    if ($cmd->getname() == "gryffindor") {
    if ($sender instanceof Player) {
    $level = $this->getServer()->getLevelByName("Hogwarts");
    $x = -1953;
    $y = 133;
    $z = 482;
    $pos = new Position($x, $y, $z, $level);
    $sender->teleport($pos);
    $sender->sendMessage($this->fts . TF::GREEN . "Teleported to Gryffindor common room!"); 
     
  2. UnknownOre

    UnknownOre Silverfish

    Messages:
    21
    GitHub:
    UnknownOre
    PHP:
    use pocketmine\level\Position;
     
  3. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    missing the
    PHP:
    use pocketmine\level\Position;
     
  4. Clik

    Clik Spider Jockey

    Messages:
    25
    GitHub:
    KadTheHunter
  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.