Hello, guys. TodayI will show how to use functions from anotherplugin on your server. Firstly, we will get this plugin. PHP: $this->pl=$this->getServer()->getPluginManager()->getPlugin("MyPlugin"); Than, for example, want make mysql connections for our plugins. And we will make one thing in onEnable() function: PHP: $this->mysqli=new \mysqli("ip", "user", "password", "database"); But we know, that some users have limit of mysql connections to mysql database. So with this function we can make 1 connection for 2 plugins. But how? To do this, we must have in second plugin some function, that uses mysql. Example getParticle() PHP: public function getParticle($player){ $player=strtolower($player); $result = $this->pl->mysqli->query("SELECT FROM `table` WHERE `nick` = "'.$player.'""); $data=$result->fetch_assoc(); return $data['particle'];} That we used mysql function from another plugin to use mysql or second plugin.
This is not plugin API at all. This is just a way of sharing database instance. For real plugin APIs, the getParticle() method should be located in the first plugin. Sharing database instance is not what a plugin API should do.