public interface ISkillHelper
Interface for skill related helper methods.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint)
    Adds a skill point of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint, int amount)
    Adds skill points of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint)
    Adds a skill point of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint, int amount)
    Adds skill points of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint)
    Adds a skill point of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint, int amount)
    Adds skill points of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint)
    Adds a skill point of a given type to a given player.
    void
    addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint, int amount)
    Adds skill points of a given type to a given player.
    boolean
    canLearn(net.minecraft.world.entity.player.Player player, Skill skill)
     
    boolean
    canLearn(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill, net.minecraft.core.RegistryAccess registryAccess)
     
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint)
    Consumes one skill point of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint, int amount)
    Consumes skill points of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint)
    Consumes one skill point of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint, int amount)
    Consumes skill points of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint)
    Consumes one skill point of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint, int amount)
    Consumes skill points of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint)
    Consumes one skill point of a given type for a given player.
    boolean
    consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint, int amount)
    Consumes skill points of a given type for a given player.
    void
    forget(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
    Locks the given skill for the given player.
    void
    forget(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
    Locks the given skill for the given player.
    void
    forgetAll(net.minecraft.world.entity.player.Player player)
    Locks all skills for the given player.
    Collection<net.minecraft.resources.ResourceLocation>
    getKnownSkills(net.minecraft.world.entity.player.Player player)
     
    net.minecraft.world.item.ItemStack
     
    net.minecraft.world.item.ItemStack
    getOrbForSkillPoint(net.minecraft.resources.ResourceLocation skillPoint)
     
    int
    getSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint point)
     
    int
    getSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation point)
     
    getSkillPointForStack(net.minecraft.world.item.ItemStack stack)
     
    <T extends net.minecraft.world.item.Item & ISkillPointItem>
    net.minecraft.world.item.ItemStack
    getStackForSkillPoint(T item, SkillPoint skillPoint)
     
    <T extends net.minecraft.world.item.Item & ISkillPointItem>
    net.minecraft.world.item.ItemStack
    getStackForSkillPoint(T item, net.minecraft.resources.ResourceLocation skillPoint)
     
    boolean
    knows(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
     
    boolean
    knows(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
     
    void
    learn(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
    Unlocks the given skill for the given player.
    void
    learn(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
    Unlocks the given skill for the given player.
    void
    learnAll(net.minecraft.world.entity.player.Player player, net.minecraft.core.RegistryAccess registryAccess)
    Unlocks all skills for the given player.
  • Method Details

    • knows

      boolean knows(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
      Parameters:
      player - The player to check the skill knowledge for.
      skill - The id of the skill to check for.
      Returns:
      True if the given player knows the given skill, false otherwise.
    • knows

      boolean knows(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
      Parameters:
      player - The player to check the skill knowledge for.
      skill - The skill to check for.
      Returns:
      True if the given player knows the given skill, false otherwise.
    • canLearn

      boolean canLearn(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill, net.minecraft.core.RegistryAccess registryAccess)
      Parameters:
      player - The player to check the skill requirements for.
      skill - The id of the skill to check for.
      Returns:
      True if the given player can learn the given skill, false otherwise.
    • canLearn

      boolean canLearn(net.minecraft.world.entity.player.Player player, Skill skill)
      Parameters:
      player - The player to check the skill requirements for.
      skill - The skill to check for.
      Returns:
      True if the given player can learn the given skill, false otherwise.
    • learn

      void learn(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
      Unlocks the given skill for the given player.
      Parameters:
      player - The player to unlock the skill for.
      skill - The id of the skill to unlock.
    • learn

      void learn(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
      Unlocks the given skill for the given player.
      Parameters:
      player - The player to unlock the skill for.
      skill - The skill to unlock.
    • forget

      void forget(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skill)
      Locks the given skill for the given player.
      Parameters:
      player - The player to lock the skill for.
      skill - The id of the skill to lock.
    • forget

      void forget(net.minecraft.world.entity.player.Player player, Skill skill, net.minecraft.core.RegistryAccess registryAccess)
      Locks the given skill for the given player.
      Parameters:
      player - The player to lock the skill for.
      skill - The skill to lock.
    • learnAll

      void learnAll(net.minecraft.world.entity.player.Player player, net.minecraft.core.RegistryAccess registryAccess)
      Unlocks all skills for the given player.
      Parameters:
      player - The player to unlock the skills for.
    • forgetAll

      void forgetAll(net.minecraft.world.entity.player.Player player)
      Locks all skills for the given player.
      Parameters:
      player - The player to lock the skills for.
    • getSkillPoint

      int getSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation point)
      Parameters:
      player - The player to get the skill points for.
      point - The id of the skill point to get the amount for.
      Returns:
      The amount of skill points of the given skill point type the given player has.
    • getSkillPoint

      int getSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint point)
      Parameters:
      player - The player to get the skill points for.
      point - The skill point to get the amount for.
      Returns:
      The amount of skill points of the given skill point type the given player has.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint, int amount)
      Adds skill points of a given type to a given player.
      Parameters:
      player - The player to add the skill points to.
      skillPoint - The id of the skill point type to add.
      amount - The amount of skill points to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint, int amount)
      Adds skill points of a given type to a given player.
      Parameters:
      player - The player to add the skill points to.
      skillPoint - The id of the skill point type to add.
      amount - The amount of skill points to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint, int amount)
      Adds skill points of a given type to a given player.
      Parameters:
      player - The player to add the skill points to.
      skillPoint - The id of the skill point type to add.
      amount - The amount of skill points to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint, int amount)
      Adds skill points of a given type to a given player.
      Parameters:
      player - The player to add the skill points to.
      skillPoint - The skill point type to add.
      amount - The amount of skill points to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint)
      Adds a skill point of a given type to a given player.
      Parameters:
      player - The player to add the skill point to.
      skillPoint - The id of the skill point type to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint)
      Adds a skill point of a given type to a given player.
      Parameters:
      player - The player to add the skill point to.
      skillPoint - The id of the skill point type to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint)
      Adds a skill point of a given type to a given player.
      Parameters:
      player - The player to add the skill point to.
      skillPoint - The id of the skill point type to add.
    • addSkillPoint

      void addSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint)
      Adds a skill point of a given type to a given player.
      Parameters:
      player - The player to add the skill point to.
      skillPoint - The skill point type to add.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint, int amount)
      Consumes skill points of a given type for a given player.
      Parameters:
      player - The player to consume the skill points of.
      skillPoint - The id of the skill point type to consume.
      amount - The amount of skill points to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint, int amount)
      Consumes skill points of a given type for a given player.
      Parameters:
      player - The player to consume the skill points of.
      skillPoint - The id of the skill point type to consume.
      amount - The amount of skill points to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint, int amount)
      Consumes skill points of a given type for a given player.
      Parameters:
      player - The player to consume the skill points of.
      skillPoint - The id of the skill point type to consume.
      amount - The amount of skill points to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint, int amount)
      Consumes skill points of a given type for a given player.
      Parameters:
      player - The player to consume the skill points of.
      skillPoint - The skill point type to consume.
      amount - The amount of skill points to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceLocation skillPoint)
      Consumes one skill point of a given type for a given player.
      Parameters:
      player - The player to consume the skill point of.
      skillPoint - The id of the skill point type to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.resources.ResourceKey<SkillPoint> skillPoint)
      Consumes one skill point of a given type for a given player.
      Parameters:
      player - The player to consume the skill point of.
      skillPoint - The id of the skill point type to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, net.minecraft.core.Holder<SkillPoint> skillPoint)
      Consumes one skill point of a given type for a given player.
      Parameters:
      player - The player to consume the skill point of.
      skillPoint - The id of the skill point type to consume.
      Returns:
      Whether the consumption was successful or not.
    • consumeSkillPoint

      boolean consumeSkillPoint(net.minecraft.world.entity.player.Player player, SkillPoint skillPoint)
      Consumes one skill point of a given type for a given player.
      Parameters:
      player - The player to consume the skill point of.
      skillPoint - The skill point type to consume.
      Returns:
      Whether the consumption was successful or not.
    • getOrbForSkillPoint

      net.minecraft.world.item.ItemStack getOrbForSkillPoint(net.minecraft.resources.ResourceLocation skillPoint)
      Parameters:
      skillPoint - The id of the skill point type to get the orb stack for.
      Returns:
      An item stack containing the orb.
    • getOrbForSkillPoint

      net.minecraft.world.item.ItemStack getOrbForSkillPoint(SkillPoint skillPoint)
      Parameters:
      skillPoint - The skill point type to get the orb stack for.
      Returns:
      An item stack containing the orb.
    • getStackForSkillPoint

      <T extends net.minecraft.world.item.Item & ISkillPointItem> net.minecraft.world.item.ItemStack getStackForSkillPoint(T item, net.minecraft.resources.ResourceLocation skillPoint)
      Type Parameters:
      T - The item implementing ISkillPointItem.
      Parameters:
      item - The item to make the item stack from.
      skillPoint - The id of the skill point type to set on the item stack.
      Returns:
      An item stack of the given item with the given skill point type stored in it.
    • getStackForSkillPoint

      <T extends net.minecraft.world.item.Item & ISkillPointItem> net.minecraft.world.item.ItemStack getStackForSkillPoint(T item, SkillPoint skillPoint)
      Type Parameters:
      T - The item implementing ISkillPointItem.
      Parameters:
      item - The item to make the item stack from.
      skillPoint - The skill point type to set on the item stack.
      Returns:
      An item stack of the given item with the given skill point type stored in it.
    • getSkillPointForStack

      SkillPoint getSkillPointForStack(net.minecraft.world.item.ItemStack stack)
      Parameters:
      stack - The stack to get the skill point type from.
      Returns:
      The skill point type stored in the stack, or null if the stack does not contain one.
    • getKnownSkills

      Collection<net.minecraft.resources.ResourceLocation> getKnownSkills(net.minecraft.world.entity.player.Player player)
      Parameters:
      player - The player to get the skills for.
      Returns:
      An unmodifiable collection of the given player's known skills.