Events, Spawns, Source Servers, and many more!

User Tools

Site Tools


mobsistence:hooking-the-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

mobsistence:hooking-the-api [2015/01/14 22:02] (current)
sylian created
Line 1: Line 1:
 +Here's an example of how to add the API to your plugin
 +<code Java>
 +private API getMobsistenceAPI()
 +{
 +    org.bukkit.plugin.Plugin mobsistencePlugin = Bukkit.getPluginManager().getPlugin("​Mobsistence"​);​
 +    if (mobsistencePlugin != null && mobsistencePlugin instanceof Mobsistence)
 +    {
 +        return ((Mobsistence)mobsistencePlugin).API;​
 +    }
 +    ​
 +    return null;
 +}
 +</​code>​
  
 +Once you've done that you can store the returned API and use it later.
mobsistence/hooking-the-api.txt ยท Last modified: 2015/01/14 22:02 by sylian