So hello, i make an API and i have this error : Code: Error: "Call to undefined method ClassAPI\Main::setup()" (EXCEPTION) in "plugins/Template/src/Template/Main" at line 15 Here is my code Main ClassAPI PHP: <?phpdeclare(strict_types = 1);namespace ClassAPI;use ClassAPI\API\ClassHandler;use pocketmine\plugin\PluginBase;use pocketmine\utils\TextFormat as TF;class Main extends PluginBase { public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents(new ClassHandler($this), $this); $this->getLogger()->info(TF::GREEN . " is enabled !"); } public function onDisable(){ $this->getLogger()->info(TF::RED . " is disabled !"); }}?> Main Template PHP: <?phpnamespace Template;use pocketmine\plugin\PluginBase;use pocketmine\utils\TextFormat as TF;class Main extends PluginBase { public $api; public function onEnable(){ $this->getLogger()->info(TF::GREEN . " is enabled !"); $this->api = $this->getServer()->getPluginManager()->getPlugin("ClassAPI"); $this->api->setup(); } public function onDisable(){ $this->getLogger()->info(TF::RED . " is disabled !"); }}?>
@Fadhel could of at least have given him some references. Anyways, try to learn how to understand and reproduce your errors. Read through every single line, make sure it makes sense (Don't do that if you have a big plugin). Also you shouldn't make your own API plugin as a beginner, try making some draft plugins, explore PMMP's API, learn more about PHP's in-built functionalities.
How is that helpful? Show your ClassHandler file's code please? Also why do you have two PluginBases?
it is helpful he must learn PHP instead of wasting his time asking for help, this is common sense. the thread is already solved i don't get why you are mentioning me on this solved thread.