Hi. How may I will get a list from config? Example, this is my config: Code: worlds: - "Survival" - "FFA" This is my main: PHP: public function playerChange(EntityLevelChangeEvent $event){ $player = $event->getEntity(); $worlds = $this->worlds->get("worlds"){//$this->worlds is config.yml But it doesn't works. Help plz
PHP: public function playerChange(EntityLevelChangeEvent $event){ $player = $event->getEntity(); $worlds = $this->worlds->getNested("worlds");}
If I understand correctly you want to take the array of your world from your config and use them only on this world if I'm wrong on your question. Try: PHP: public function onLevelChange(EntityLevelChangeEvent $event){ $entity = $event->getEntity(); $worlds = (array) $this->worlds->getAll()['worlds']; if(in_array($entity->getLevel()->getFolderName(), $worlds)){ //continue your code ... } }