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

Plugin crash

Discussion in 'Development' started by Jonas, Mar 20, 2017.

  1. Jonas

    Jonas Baby Zombie

    Messages:
    192
    My Plugin crash when i join on my server with this error:
    “Call to a undefined method pocketmine\Server::getDeafaultSpawn()“ (EXCEPTION)
    Here is my Code
    PHP:
    <?php

    namespace Main;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\utils\TextFormat as Color;
    use 
    pocketmine\item\Item;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\Player;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\event\player\PlayerJoinEvent;
    use 
    pocketmine\event\player\PlayerQuitEvent;
    use 
    pocketmine\event\player\PlayerRespawnEvent;
    use 
    pocketmine\event\player\PlayerDeathEvent;
    use 
    pocketmine\event\entity\EntityDamageEvent;
    use 
    pocketmine\event\entity\EntityDamageByEntityEvent;
    use 
    pocketmine\entity\Effect;
    use 
    pocketmine\event\block\BlockBreakEvent;
    use 
    pocketmine\level\Level;
    use 
    pocketmine\math\Vector3;
    use 
    pocketmine\event\player\PlayerInteractEvent as PIE;
    use 
    pocketmine\item\enchantment\Enchantment;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\Server;

    class 
    SoupFFA extends PluginBase implements Listener {
       
        public 
    $prefix Color::AQUA"Soup"Color::RED "FFA" Color::GRAY " |";
       
        public function 
    onEnable() {
           
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
            
    $this->getLogger()->info($this->prefix Color::GREEN " wurde Aktiviert!");
            
    $this->getLogger()->info($this->prefix "Made By " Color::GOLD " Jonas!");
           
        }
       
        public function 
    onJoin(PlayerJoinEvent $event) {
           
            
    $player $event->getPlayer();
            
    $player->teleport($this->getServer()->getDefaultSpawn()->getSaveSpawn());
    Thats not all. The Error is in the last line from my Code.
     
  2. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    It is getDefaultLevel() and getSafeSpawn()
     
  3. Jonas

    Jonas Baby Zombie

    Messages:
    192
    Thanks its 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.