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

Error 2

Discussion in 'Development' started by sdsd16, Mar 10, 2019.

  1. sdsd16

    sdsd16 Spider Jockey

    Messages:
    41
    GitHub:
    Danding1314
    [18:55:02] [Server thread/CRITICAL]: ErrorException: "Undefined index: Commands" (EXCEPTION) in "plugins/SEXDCore_SB/src/xinghao2003/SEXDCore/Main" at line 44


    public function onEnable() : void{
    $this->getServer()->getPluginManager()->registerEvents($this, $this);
    #############################
    $this->saveDefaultConfig();
    $c = $this->getConfig()->getAll();
    foreach ($c["Commands"] as $i) { <== here error
    $this->getScheduler()->scheduleRepeatingTask(new TimeCommand($this, $i["Command"]), $i["Time"] * 1200);
    #############################
    $this->saveItems();
    #############################
    $this->g1 = new Config($this->getDataFolder()."1.yml",Config::YAML,[]);
    $this->g2 = new Config($this->getDataFolder()."2.yml",Config::YAML,[]);
    $this->g3 = new Config($this->getDataFolder()."3.yml",Config::YAML,[]);
    $this->g4 = new Config($this->getDataFolder()."4.yml",Config::YAML,[]);
    #############################
    $this->saveResource("serverui.json");
    $this->conf = new Config($this->getDataFolder()."prefix.yml",Config::YAML,[]);
    #############################



    $this->getLogger()->info("SEXDCore Enable");
    }
     
  2. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    we cant help you if you dont give us complete source
    i think you didnt check if commands index is set in config
     
  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.