Hi guys, I'm working on a chat plugin and I don't really understand how to get and set stuff from the config. Exampe: $this->config->exists("ranks")[$this->getRank($player->username)] doesnt work as it says "cant use exists on a non-object" Code: PHP: <?php/*__PocketMine Plugin__name=MultiCbatversion=1.0description=Separate chat for each worldauthor=Lamboclass=multichatapiversion=11*/class multichat implements Plugin{ private $api; public function __construct(ServerAPI $api, $server = false){ $this->api = $api; } public function __destruct(){} public function init(){ $this->api->addHandler("player.chat", array($this,"onChat")); $this->config = new Config($this->api->plugin->configPath($this)."config.yml", CONFIG_YAML, array( "ranks"=> array( "default"=> array( "world"=> array( "tag"=>"Player","chat-format"=>"|@tag|@player: @message" ) ), "moderator"=> array( "world"=>array( "tag"=>"Mod","chat-format"=>"|@tag|@player: @message" ) ), "admin"=> array( "world"=>array( "tag"=>"Admin","chat-format"=>"|@tag|@player: @message" ) ), "owner"=>array( "world"=>array( "tag"=>"Owner","chat-format"=>"|@tag|@player: @message" ) ), "vip"=> array( "world"=>array( "tag"=>"ViP","chat-format"=>"|@tag|@player: @message" ) ) ), "in-ranks"=>array( "ranks" => array( "moderator"=>array(), "admin"=>array(), "owner"=>array(), "vip"=>array() ) ) ) ); } public function onChat($data){ $player = $data["player"]; $message = $data["message"]; $level = $player->level->getName(); $tag = $this->config->get("ranks")[$this->getRank($player->username)]["tag"]; $format = $this->config->get("ranks")[$this->getRank($player->username)]["chat-format"]; $username = $player->username; foreach($this->api->player->getAll($level) as $players){ if($this->config->exists("ranks")[$this->getRank($player->username)][$level]){ $players->sendChat(str_replace(array("@tag","@player"),array($tag,$username),$format)); }else{ $this->config->set("ranks")[$this->getRank($player->username)][$level][$this->config->get("ranks")[$this->getRank($player->username)]["tag"]];//basically creates the other world in the config $this->config->set("ranks")[$this->getRank($player->username)][$level][$this->config->get("ranks")[$this->getRank($player->username)]["chat-format"]]; $players->sendChat(str_replace(array("@tag","@player"),array($tag,$username),$format)); } } } So can you guys teach me how to use configs like the way im using them in my code? PS: I have the function $this->getRank defined in my code Thanks.