Class PathfinderUseItem

java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderUseItem
All Implemented Interfaces:
Conditional<Mob>, PathfinderInfo

public final class PathfinderUseItem extends Pathfinder implements Conditional<Mob>
Represents a Pathfinder for a Mob to use an Item
  • Constructor Details

    • PathfinderUseItem

      public PathfinderUseItem(@NotNull @NotNull Mob m, @NotNull @NotNull ItemStack item, @NotNull @NotNull Predicate<Mob> requirements) throws IllegalArgumentException
      Constructs a PathfinderUseItem with Sound.ENTITY_PLAYER_BURP.
      Parameters:
      m - Mob to use
      item - ItemStack to use
      requirements - Requirements to use the item
      Throws:
      IllegalArgumentException - if requirements or item are null
    • PathfinderUseItem

      public PathfinderUseItem(@NotNull @NotNull Mob m, @NotNull @NotNull ItemStack item, @NotNull @NotNull Predicate<Mob> requirements, @Nullable @Nullable Sound finishSound) throws IllegalArgumentException
      Constructs a PathfinderUseItem.
      Parameters:
      m - Mob to use
      item - ItemStack to use
      requirements - Requirements to use the item
      finishSound - Sound to use when finished
      Throws:
      IllegalArgumentException - if requirements or item are null
  • Method Details

    • getFinishSound

      @NotNull public @NotNull Sound getFinishSound()
      Gets the current sound used when the item is finished.
      Returns:
      Sound used
    • setFinishSound

      public void setFinishSound(@Nullable @Nullable Sound s)
      Sets the current sound used when the item is finished.
      Parameters:
      s - Sound to use
    • getItem

      @NotNull public @NotNull ItemStack getItem()
      Gets the current item that will be used.
      Returns:
      ItemStack used
    • setItem

      public void setItem(@NotNull @NotNull ItemStack i) throws IllegalArgumentException
      Sets the current item that will be used.
      Parameters:
      i - ItemStack to use
      Throws:
      IllegalArgumentException - if item is null
    • getCondition

      @NotNull public @NotNull Predicate<Mob> getCondition()
      Description copied from interface: Conditional
      Sets the Condition of this Conditional Pathfinder.
      Specified by:
      getCondition in interface Conditional<Mob>
      Returns:
      Predicate of Condition
    • setCondition

      public void setCondition(@NotNull @NotNull Predicate<Mob> req) throws IllegalArgumentException
      Description copied from interface: Conditional
      Sets the Condition of this Conditional Pathfinder.
      Specified by:
      setCondition in interface Conditional<Mob>
      Parameters:
      req - Condition to set
      Throws:
      IllegalArgumentException - if requirements are null
    • getFlags

      @NotNull public @NotNull Pathfinder.PathfinderFlag[] getFlags()
      Description copied from class: Pathfinder

      Fetches an Array of Flags that this Pathfinder has.

      Specified by:
      getFlags in class Pathfinder
      Returns:
      Array of Pathfinder Flags
    • getInternalName

      public String getInternalName()
      Description copied from interface: PathfinderInfo
      Returns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.
      Specified by:
      getInternalName in interface PathfinderInfo
      Returns:
      Internal Name