-
Notifications
You must be signed in to change notification settings - Fork 0
Development API
Terry edited this page Nov 11, 2024
·
8 revisions
⚠️ Currently not available.
⚠️ Currently not available.
You need to add WizardAPI as dependency in your plugin.
plugin.yml
depend: [WizardAPI]
paper-plugin.yml
dependencies:
server:
WizardAPI:
load: BEFORE
required: true
// You need to specify a id (string) for every wand.
Wand wand = new Wand("custom_wand", new ItemStack(Material.STICK)); // You can use any itemstack here
Spell spell = new Spell(player -> {
// Spell Logic
}, Spell.ClickType.LEFT, Spell.ClickType.RIGHT, Spell.ClickType.RIGHT); // Combination: L-R-R
/*
You can add up to multiple spells. But you have maximum of 8 since the combinations are limited.
Possible Combinations: L-L-L, L-L-R, L-R-L, L-R-R, R-R-R, R-R-L, R-L-R, R-R-L
*/
wand.bind(spell);
// You need to register wands into the API
WizardAPI.getInstance().register(wand);
WizardAPI api = WizardAPI.getInstance(); // Get instance
api.register(Wand wand); // Register wand
api.getWandById(String id); // Get Wand by ID
api.getWandByItem(ItemStack itemstack); // Get Wand by ItemStack
api.isWand(ItemStack itemstack); // Checks if a ItemStack is a Wand
api.getAllWands(); // Get all wands