Hello How i can link any plugin with my plugin?, where i can use its codes in my plugin, if i can how? I tried but it is not working! i hope you understand me
I think I understand what you mean, if the methods are static you can: PHP: use namespace/to/class; If they aren't static: PHP: $plugin = $this->getServer()->getPluginManager()->getPlugin('MyPlugin');$plugin->whatever(...$args); EDIT: For both code snippets the methods you are trying to call MUST be public.
First of all, the functions of the other plugin you want to link and use must be a public function. There are 3 types of functions: public, private, protected. public - All classes can use it private - Only owning class can use it protected - Owning class plus all extending classes can use it Let us start an example with EconomyAPI by onebone. Pocketmine's plugin manager let's you access other plugin's main class. PHP: $economyAPI = Server::getInstance()->getPluginManager()->getPlugin('EconomyAPI'); This will return the main class of EconomyAPI if the plugin is installed on the server You can make it so your plugin won't load without EconomyAPI by adding " depend: ['EconomyAPI'] " to plugin.yml Hope this helps Explained !