Interface SkillsUser


public interface SkillsUser
  • Method Details

    • getUuid

      UUID getUuid()
      Gets the Minecraft UUID of the player.
      Returns:
      the player's UUID
    • isLoaded

      boolean isLoaded()
      Whether the instance represents an online user that is loaded into memory. If the user is not loaded, get methods will return default values and set methods will have no effect.
      Returns:
      whether the user is loaded
    • getSkillXp

      double getSkillXp(Skill skill)
      Gets the current amount of XP in a skill. The amount ranges from 0 to the XP required to progress to the next skill level.
      Parameters:
      skill - the skill to get XP from
      Returns:
      the XP amount
    • addSkillXp

      void addSkillXp(Skill skill, double amountToAdd)
      Adds XP to a skill as if earned in game. The final amount of XP added to the player may be modified by abilities and multipliers.
      Parameters:
      skill - the skill to add XP to
      amountToAdd - the amount of XP to add
    • addSkillXp

      void addSkillXp(Skill skill, double amountToAdd, XpSource source)
      Adds XP to a skill as if earned in game with a specific XP source. The final amount of XP added to the player may be modified by abilities and multipliers.
      Parameters:
      skill - the skill to add XP to
      amountToAdd - the amount of XP to add
      source - the source of the XP
    • addSkillXpRaw

      void addSkillXpRaw(Skill skill, double amountToAdd)
      Adds an exact amount of XP to a skill, bypassing in-game abilities and multipliers.
      Parameters:
      skill - the skill to add XP to
      amountToAdd - the exact amount of XP to add
    • setSkillXp

      void setSkillXp(Skill skill, double amount)
      Sets the XP of a skill to the given amount.
      Parameters:
      skill - the skill to set the XP of
      amount - the amount of XP to set
    • getSkillLevel

      int getSkillLevel(Skill skill)
      Gets the level of a skill.
      Parameters:
      skill - the skill to get the level of
      Returns:
      the skill level
    • setSkillLevel

      void setSkillLevel(Skill skill, int level)
      Sets the level of a skill.
      Parameters:
      skill - the skill to set the level of
      level - the level to set to
    • getSkillAverage

      double getSkillAverage()
      Gets the user's average skill level of all enabled skills.
      Returns:
      the skill average
    • getStatLevel

      double getStatLevel(Stat stat)
      Gets the level of a stat.
      Parameters:
      stat - the stat to get the level of
      Returns:
      the level of the stat
    • getBaseStatLevel

      double getBaseStatLevel(Stat stat)
      Gets the level of a stat without any stat modifiers. The base level is the amount obtained only from the permanent rewards for leveling skills.
      Parameters:
      stat - the stat to get the base level of
      Returns:
      the base stat level
    • getMana

      double getMana()
      Gets the current mana of the player.
      Returns:
      the current mana
    • getMaxMana

      double getMaxMana()
      Gets the maximum mana of the player.
      Returns:
      the maximum mana
    • setMana

      void setMana(double mana)
      Sets the mana of the player.
      Parameters:
      mana - the amount of mana to set
    • consumeMana

      boolean consumeMana(double amount)
      Attempts to consume the specified amount of mana, simulating using a mana ability. Will only consume if the user's mana is greater than or equal to amount. If the player does not have enough mana, a "Not enough mana" message will be sent to the user's action bar. Does not send any message if successful, you must handle that.
      Parameters:
      amount - the amount to consume
      Returns:
      true if the user had enough mana and the operation was successful, false if not
    • getPowerLevel

      int getPowerLevel()
      Gets the power level of the player. The power level is the sum of all skill levels.
      Returns:
      the power level
    • addStatModifier

      void addStatModifier(StatModifier statModifier)
      Adds a stat modifier to the player. Stat modifiers are temporary changes to a stat that require a name to be identified and removed.
      Parameters:
      statModifier - the stat modifier to add
    • removeStatModifier

      void removeStatModifier(String name)
      Removes a stat modifier from the player.
      Parameters:
      name - the name of the stat modifier to remove
    • getStatModifier

      @Nullable @Nullable StatModifier getStatModifier(String name)
      Gets a stat modifier from its name.
      Parameters:
      name - the name of the modifier
      Returns:
      the stat modifier, or null if none exists with the name.
    • getStatModifiers

      Map<String,StatModifier> getStatModifiers()
      Gets a map of all the user's stat modifiers.
      Returns:
      the map of all stat modifiers
    • addTraitModifier

      void addTraitModifier(TraitModifier traitModifier)
      Adds a trait modifier to the player.
      Parameters:
      traitModifier - the trait modifier
    • removeTraitModifier

      void removeTraitModifier(String name)
      Removes a trait modifier from the player with a given name.
      Parameters:
      name - the name of the trait modifier to remove
    • getTraitModifier

      @Nullable @Nullable TraitModifier getTraitModifier(String name)
      Gets a trait modifier from its name
      Parameters:
      name - the name of the modifier
      Returns:
      the trait modifier, or null if none exists with the name.
    • getTraitModifiers

      Map<String,TraitModifier> getTraitModifiers()
      Gets a map of all the user's trait modifiers.
      Returns:
      the map of all trait modifiers
    • getEffectiveTraitLevel

      double getEffectiveTraitLevel(Trait trait)
      Gets the total level of a trait, including non-plugin base values.
      Parameters:
      trait - the trait to get the level of
      Returns:
      the total effective level
    • getBonusTraitLevel

      double getBonusTraitLevel(Trait trait)
      Gets the level of a trait from only the plugin's stats and trait modifiers.
      Parameters:
      trait - the trait to get the level of
      Returns:
      the bonus trait level
    • getAbilityLevel

      int getAbilityLevel(Ability ability)
      Gets the level of an ability.
      Parameters:
      ability - the ability to get the level of
      Returns:
      the level of the ability
    • getManaAbilityLevel

      int getManaAbilityLevel(ManaAbility manaAbility)
      Gets the level of a mana ability.
      Parameters:
      manaAbility - the mana ability to get the level of
      Returns:
      the level of the mana ability
    • getLocale

      Locale getLocale()
      Gets the locale of the player, or the server default locale if the player has not set a locale.
      Returns:
      the locale of the player
    • hasSkillPermission

      boolean hasSkillPermission(Skill skill)
      Gets whether the player the permission node to use a skill. The checked node is the format auraskills.skill.[skillName], which is true by default.
      Parameters:
      skill - the skill to check
      Returns:
      whether the player has the permission