How to Get config from Main to other Class? Config wrote at function onEnable in Main $this->plugin->onEnable->config->get or This? PHP: Public function __construct(Main $plugin){ $this->plugin = $plugin;}Public function onJoin(PlayerJoinEvent $ev){ $name = $ev->getName(); $config = $this->plugin->config->get($name);}
PHP: $otherObject = new OtherClass($config); // Pass it via constructor$otherObject->config = new $config; // Assign it to object property This isn't even pocketmine related. Just look up PHP OOP, watch 5 min tutorial and you know all. Thank me later.