Advanced Abilities API
-
Contents
How to create an ability(top)
- Download the jar and add it in your library.
- Create a class and extend it to AbilityCreator, then add the super constructor.
- Implement this interface (AbilityCreatorLoader) in your JavaPlugin class and add the interface method, if you want to load more than one ability you have to use the interface named 'AbilityMultiCreatorLoader'.
- Instance your ability in getAbility() method of AbilityCreatorLoader interface.
- Build the file and add it in your '/plugins/AdvancedAbilities/abilities/api/' folder.
Code (Text):public final class Main extends JavaPlugin implements AbilityCreatorLoader {
@Override
public AbilityCreator getAbility() {
return new YourAbility();
}
}
Code (Text):getConfiguration() -> setLogo(ItemStack) | setDescription(List<String>) | setName(String)Code (Text):getLevelConfiguration(int) -> setDescription(List<String>) | setPrice(double) | setXp(double) : setPriceType(String)Code (Text):getUtils() -> abilityIsDisabled(UUID) | playerHasLevel(UUID, int) | sendAbilityMessage(UUID)Code (Text):getId() returns (String) idCode (Text):getMaxLevel() returns (int) max_level;
How to hook an economy system(top)
- Download the jar and add it in your library.
- Create a class and extends to EconomyHook.
- Add EconomyHook methods (playerMoney & withdrawMoney).
- Instance your economy class in your onEnable method (JavaPlugin).
- Add the file in your plugins folder.
How to use mana(top)
You can use the static methods of Mana (be.anybody.api.advancedabilities.mana.Mana):
- addMana(Player, double); // Add mana.
- getMana(Player); // Get player mana.
- subtractMana(Player, double); // Subtract mana.
- showMana(Player); // Player will see their mana (you can configure this in mana.yml -> mana_display_type).
How to use the API events(top)
Events:
- AbilityRpgLevelUpEvent
- AbilityUseEvent:
- Special events:
- - ExplosiveArrowHitEvent
- - MiningLuckEvent
- - WoodchoppingLuckEvent
- AbilityEnableEvent
- AbilityDisableEvent
- AbilityLevelPurchaseEvent
- SelectClassEvent
Code (Text):@EventHandler
public void event(AbilityUseEvent event) {
if (event.getAbilityId().equals("explosive_arrow")) {
if (event.getSpecialAbilityEvent() != null) {
for (final Block block : ((ExplosiveArrowHitEvent) event.getSpecialAbilityEvent()).getBlocks()) {
if (block.getType() == Material.WOOD) {
event.setCancelled(true);
}
}
}
}
}
How to use PlayerStats(top)
You can use this class (be.anybody.api.advancedabilities.ability.stats) to get and set player level and exp.
- setLevel(Player, String, int);
- setExp(Player, String, double)
- getExp(Player, String)
- getLevel(Player, String)
- enableAbility(Player, String)
- disableAbility(Player, String)
- getMana(Player)
- getMaxMana(Player)
- getSelectedAbilities(Player)
- getMaxAbilitiesLimit(Player)
- Loading...
- Loading...
XenCarta PRO
© Jason Axelrod from 8WAYRUN.COM