Class PathfinderUseItem
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderUseItem
- All Implemented Interfaces:
Conditional<Mob>, PathfinderInfo
Represents a Pathfinder for a Mob to use an Item
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
Fields inherited from class Pathfinder
entity -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderUseItem(@NotNull Mob m, @NotNull ItemStack item, @NotNull Predicate<Mob> requirements) Constructs a PathfinderUseItem withSound.ENTITY_PLAYER_BURP.PathfinderUseItem(@NotNull Mob m, @NotNull ItemStack item, @NotNull Predicate<Mob> requirements, @Nullable Sound finishSound) Constructs a PathfinderUseItem. -
Method Summary
Modifier and TypeMethodDescriptionSets the Condition of this Conditional Pathfinder.@NotNull SoundGets the current sound used when the item is finished.@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.@NotNull ItemStackgetItem()Gets the current item that will be used.voidsetCondition(@NotNull Predicate<Mob> req) Sets the Condition of this Conditional Pathfinder.voidsetFinishSound(@Nullable Sound s) Sets the current sound used when the item is finished.voidSets the current item that will be used.Methods inherited from class Pathfinder
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PathfinderInfo
getName
-
Constructor Details
-
PathfinderUseItem
public PathfinderUseItem(@NotNull @NotNull Mob m, @NotNull @NotNull ItemStack item, @NotNull @NotNull Predicate<Mob> requirements) throws IllegalArgumentException Constructs a PathfinderUseItem withSound.ENTITY_PLAYER_BURP.- Parameters:
m- Mob to useitem- ItemStack to userequirements- 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 useitem- ItemStack to userequirements- Requirements to use the itemfinishSound- Sound to use when finished- Throws:
IllegalArgumentException- if requirements or item are null
-
-
Method Details
-
getFinishSound
Gets the current sound used when the item is finished.- Returns:
- Sound used
-
setFinishSound
Sets the current sound used when the item is finished.- Parameters:
s- Sound to use
-
getItem
Gets the current item that will be used.- Returns:
- ItemStack used
-
setItem
Sets the current item that will be used.- Parameters:
i- ItemStack to use- Throws:
IllegalArgumentException- if item is null
-
getCondition
Description copied from interface:ConditionalSets the Condition of this Conditional Pathfinder.- Specified by:
getConditionin interfaceConditional<Mob>- Returns:
- Predicate of Condition
-
setCondition
Description copied from interface:ConditionalSets the Condition of this Conditional Pathfinder.- Specified by:
setConditionin interfaceConditional<Mob>- Parameters:
req- Condition to set- Throws:
IllegalArgumentException- if requirements are null
-
getFlags
Description copied from class:PathfinderFetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlagsin classPathfinder- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfoReturns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.- Specified by:
getInternalNamein interfacePathfinderInfo- Returns:
- Internal Name
-