Package me.gamercoder215.mobchip.ai.goal
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 me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the Condition of this Conditional Pathfinder.Gets the current sound used when the item is finished.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.getItem()
Gets the current item that will be used.void
setCondition
(@NotNull Predicate<Mob> req) Sets the Condition of this Conditional Pathfinder.void
Sets the current sound used when the item is finished.void
Sets the current item that will be used.Methods inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.gamercoder215.mobchip.ai.goal.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:Conditional
Sets the Condition of this Conditional Pathfinder.- Specified by:
getCondition
in interfaceConditional<Mob>
- Returns:
- Predicate of Condition
-
setCondition
Description copied from interface:Conditional
Sets the Condition of this Conditional Pathfinder.- Specified by:
setCondition
in interfaceConditional<Mob>
- Parameters:
req
- Condition to set- Throws:
IllegalArgumentException
- if requirements are null
-
getFlags
Description copied from class:Pathfinder
Fetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlags
in classPathfinder
- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfo
Returns the NMS Internal Name.- Specified by:
getInternalName
in interfacePathfinderInfo
- Returns:
- Internal Name
-