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

Config Problem

Discussion in 'Development' started by Muhammed0232, May 13, 2020.

  1. Muhammed0232

    Muhammed0232 Spider Jockey

    Messages:
    38
    GitHub:
    Muhammed0232
    Error:
    Code:
    BadMethodCallException: "Cannot serialize Server instance" (EXCEPTION) in "src/pocketmine/Server" at line 2551
    Code:
    PHP:
    public function setHome($getName$home$x$y$z$level){
            
    $cfg = new Config($this->p->getDataFolder()."Homes/".$getName.".yml"Config::YAML);       

       if(empty(
    $cfg->get("homelist"))){
      
    $cfg->set("homelist", array($home));
      }else{
     
    $homes $cfg->get("homelist", []);
     
    $homes[] = $home;
     
    $cfg->set("homelist"$homes);
      }
      
    $cfg->set($home, [
      
    "X" => $x,
      
    "Y" => $y,
      
    "Z" => $z,
      
    "Level" => $level,
      ]);
      
    $cfg->set("homecount"$cfg->get("homecount") + 1);
      
    $cfg->save();
     }
     
  2. Diduhless

    Diduhless Baby Zombie

    Messages:
    199
    GitHub:
    Diduhless
    You are not giving us the full error neither the lines of it
     
  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.