I'm working on a private plugin and I'm not sure if this function works, please help me. Code: public function onLoadMap($this, $map, $load){ $this->loadMap("$map")->$sender->warning("Map .$map. has been loaded!") }
use this PHP: public function onEnable (){$level = "Type the map name here";if(!$this->getServer()->isLevelLoaded($level)) {$this->getServer()->loadLevel($level);$this->getLogger()->warning($level . ' Loaded successfully!');}else{$this->getLogger()->critical("an unknown error occured while loading level " . $level . ':('); } }}
plugin.yml lets you to select to load plugins after world loading or before that (the `load` attribute). Note that plugins SHOULD NOT interact with the PocketMine API in the onLoad function.
A small thing... use PHP: $this->getLogger()->warning($level . ' Loaded successfully!'); and PHP: $this->getLogger()->critical("error happen while loading " . $level . ' :('); instead of PHP: $this->getLogger()->warning($level . 'Loaded successfully!'); and PHP: $this->getLogger()->critical("error happen while loading" . $level . ':('); xD