-
-
Notifications
You must be signed in to change notification settings - Fork 53
Use SkyBlock in your plugin
GiantQuartz edited this page Mar 27, 2020
·
1 revision
If your plugin always requires SkyBlock to work, the first step is to add it to the dependency list on your plugin manifest (plugin.yml):
depend:
- SkyBlock
There are many ways to do this, but the most common ones are these:
If your plugin is going to be published in Poggit or used by people that doesn't code, this is probably the method you should go with.
// $server must be an instance of PocketMine's Server class
// $skyblock could be null if the plugin isn't loaded!
$skyblock = $server->getPluginManager()->getPlugin("SkyBlock");
This is a less safe method to obtain SkyBlock's main class, as it will throw errors if the class is not loaded, but it comes in handy when you are certain that it will be.
$skyblock = SkyBlock::getInstance();