API

API Tutorial

Just a quick note, if you do use this plugin for the API please let me know in a PM I would love to see if people use this for the API!

VanishAPI

1. Make sure to add the BetterVanish 1.1.0 or any higher versions to your build path.

2. To vanish a player using the code call the toggleVanish method(You can call it anywhere in a method)

VanishAPI.toggleVanish(player); // The player must be an Actual 'Player' not a username.

3. In your plugin.yml make sure to depend on BetterVanish

Depend: [BetterVanish]

4. (Optional Step) Check if BetterVanish is loaded in your onEnabled()

4.1: Create a Boolean

boolean nulldepend() {
  PluginManager pm = Bukkit.getServer().getPluginManager();
  if(pm.getPlugin("BetterVanish") == null) {
       return false;
   }
return false;
}

4.2: Check in onEnabled()

public void onEnable() {
   if (nulldepend()) {
         Bukkit.getLogger().severe("Disabled due to no dependancy found");
         Bukkit.getLogger().severe("{[BetterVanish]} Not found");
   return;
   }
}

Comments

Posts Quoted:
Reply
Clear All Quotes