Wands API
Overview
Getting Started
1
2
Cache for Performance
public class MyPlugin extends JavaPlugin {
private WandAPI wandAPI;
@Override
public void onEnable() {
try {
this.wandAPI = WandAPI.get();
getLogger().info("Hooked into wands!");
} catch (IllegalStateException e) {
getLogger().warning("PhantomDungeons not loaded!");
}
}
public EnchantAPI getEnchantAPI() {
return enchantAPI;
}
}Core Operations
1
if (!wandAPI.isWand(item)) {
return;
}
String wandId = wandAPI.getWandId(item);
WandConfig config = wandAPI.getWandConfig(item);2
// Create and give separately
ItemStack wand = wandAPI.createWand("basic-wand", player);
player.getInventory().addItem(wand);
// Or give in one call
wandAPI.giveWand(player, "advanced-wand");3
Set<String> ids = wandAPI.getWandIds();
Collection<WandConfig> all = wandAPI.getAllWands();
boolean exists = wandAPI.exists("basic-wand");
int total = wandAPI.getWandCount();Cooldown Access
1
if (wandAPI.isOnCooldown(player, "basic-wand")) {
long remainingMs = wandAPI.getRemainingCooldown(player, "basic-wand");
player.sendMessage("&cWand on cooldown for " + remainingMs + "ms");
}2
// Clear one wand's cooldown
wandAPI.clearCooldown(player, "basic-wand");
// Clear all wand cooldowns for the player
wandAPI.clearAllCooldowns(player);Config Reading
1
2
Events API
1
Method
Returns
2
Method
Returns
FAQ
Last updated