Class ActiveAbility
java.lang.Object
org.woftnw.eof.ability.Ability
org.woftnw.eof.ability.ActiveAbility
-
Field Summary
Fields inherited from class Ability
DEFAULT_EFFECTS, effects, ID, name -
Constructor Summary
ConstructorsConstructorDescriptionActiveAbility(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.NamespacedKey id, net.kyori.adventure.text.TextComponent name, AbilityEffect[] effects, @Nullable org.bukkit.Material activationItemMaterial, @Nullable String itemModel, Tribe tribe, Activation activationMethod, int cooldown) Create a new ActiveAbilityActiveAbility(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.NamespacedKey id, net.kyori.adventure.text.TextComponent name, AbilityEffect[] effects, @Nullable org.bukkit.Material activationItemMaterial, @Nullable String itemModel, Tribe tribe, Activation activationMethod, int cooldown, boolean toggle) Create a new ActiveAbility -
Method Summary
Modifier and TypeMethodDescriptionvoidactivate(@NonNull org.bukkit.entity.Player user) Activate the ability.org.bukkit.inventory.ItemStackGet the activation item.Get the activation method.Methods inherited from class Ability
getId, getName, getNameAsString, notifyActivation
-
Constructor Details
-
ActiveAbility
public ActiveAbility(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.NamespacedKey id, net.kyori.adventure.text.TextComponent name, AbilityEffect[] effects, @Nullable org.bukkit.Material activationItemMaterial, @Nullable String itemModel, Tribe tribe, Activation activationMethod, int cooldown, boolean toggle) Create a new ActiveAbility- Parameters:
plugin- The origin plugin instance.id- The unique ID of this ability.name- The name of the ability.effects- The effects to apply on activation. May be empty.activationItemMaterial- The material for the activation item ornullfor the default.itemModel- The item model key for the activation item ornullif none.tribe- The tribe this ability is for.activationMethod- The activation method.cooldown- The time after activation before this ability can be activated again.toggle- Whether this is a toggle ability. Toggle abilities activate every tick if the player is using them (hold + use). When the player presses use again or selects another item, the ability stops activating.
-
ActiveAbility
public ActiveAbility(org.bukkit.plugin.java.JavaPlugin plugin, org.bukkit.NamespacedKey id, net.kyori.adventure.text.TextComponent name, AbilityEffect[] effects, @Nullable org.bukkit.Material activationItemMaterial, @Nullable String itemModel, Tribe tribe, Activation activationMethod, int cooldown) Create a new ActiveAbility- Parameters:
plugin- The origin plugin instance.id- The unique ID of this ability.name- The name of the ability.effects- The effects to apply on activation. May be empty.activationItemMaterial- The material for the activation item ornullfor the default.itemModel- The item model key for the activation item ornullif none.tribe- The tribe this ability is for.activationMethod- The activation method.cooldown- The time after activation before this ability can be activated again.
-
-
Method Details
-
getActivationItem
public org.bukkit.inventory.ItemStack getActivationItem()Get the activation item.- Returns:
- The activation item for this ability.
-
getActivationMethod
Get the activation method.- Returns:
- The activation method for this ability.
-
activate
Description copied from class:AbilityActivate the ability.- Overrides:
activatein classAbility- Parameters:
user- The player to activate this ability upon.- Throws:
AbilityActivationException- When an exception occurs that prevents the ability from being fully activated.
-