Class ActiveAbility

java.lang.Object
org.woftnw.eof.ability.Ability
org.woftnw.eof.ability.ActiveAbility

public class ActiveAbility extends Ability
Represents an Ability that is activated using an item.
  • 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 or null for the default.
      itemModel - The item model key for the activation item or null if 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 or null for the default.
      itemModel - The item model key for the activation item or null if 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

      public Activation getActivationMethod()
      Get the activation method.
      Returns:
      The activation method for this ability.
    • activate

      public void activate(@NonNull org.bukkit.entity.Player user) throws AbilityActivationException
      Description copied from class: Ability
      Activate the ability.
      Overrides:
      activate in class Ability
      Parameters:
      user - The player to activate this ability upon.
      Throws:
      AbilityActivationException - When an exception occurs that prevents the ability from being fully activated.