Class PathfinderLookAtEntity<T extends LivingEntity>
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderLookAtEntity<T>
- Type Parameters:
T- Type of LivingEntity to look at
- All Implemented Interfaces:
PathfinderInfo, Ranged, Filtering<T>, Probable
- Direct Known Subclasses:
PathfinderInteract
public class PathfinderLookAtEntity<T extends LivingEntity>
extends Pathfinder
implements Filtering<T>, Probable, Ranged
Represents a Pathfinder for an Entity to look at another Entity
-
Nested Class Summary
Nested classes/interfaces inherited from class Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final floatDefault Probability to look at an Entity (0.02F)Fields inherited from class Pathfinder
entityFields inherited from interface Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGE -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderLookAtEntity(@NotNull Mob m, @NotNull Class<T> filter) Constructs a PathfinderLookAtEntity with the defaultRanged.DEFAULT_LOOK_RANGE.PathfinderLookAtEntity(@NotNull Mob m, @NotNull Class<T> filter, float lookRange) Constructs a PathfinderLookAtEntity with the default probability.PathfinderLookAtEntity(@NotNull Mob m, @NotNull Class<T> filter, float lookRange, float probability) Constructs a PathfinderLookAtEntity with horizontal set to false.PathfinderLookAtEntity(@NotNull Mob m, @NotNull Class<T> filter, float lookRange, float probability, boolean horizontal) Constructs a PathfinderLookAtEntity. -
Method Summary
Modifier and TypeMethodDescriptionGet the filter that this Pathfinder is looking for.@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.floatGet the current probability of this Pathfinder.floatgetRange()Gets the current Range.booleanWhether the Looking Rotation is only horizontal.voidSet the Filter that this Pathfinder is looking for.voidsetHorizontal(boolean horizontal) Sets whether the Looking Rotation is only horizontal.voidsetProbability(float prob) Sets the current probability of this Pathfinder.voidsetRange(float range) Sets the current Range.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
-
Field Details
-
DEFAULT_PROBABILITY
public static final float DEFAULT_PROBABILITYDefault Probability to look at an Entity (0.02F)- See Also:
-
-
Constructor Details
-
PathfinderLookAtEntity
Constructs a PathfinderLookAtEntity with the defaultRanged.DEFAULT_LOOK_RANGE.- Parameters:
m- Mob to usefilter- Filter class to look at
-
PathfinderLookAtEntity
-
PathfinderLookAtEntity
public PathfinderLookAtEntity(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, float lookRange, float probability) Constructs a PathfinderLookAtEntity with horizontal set to false.- Parameters:
m- Mob to usefilter- Filter class to look atlookRange- Range of blocks to find selected class filterprobability- Probability (0.0 - 1.0) to look at something. Called every tick, recommended to be a low number. SeeDEFAULT_PROBABILITY.
-
PathfinderLookAtEntity
public PathfinderLookAtEntity(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, float lookRange, float probability, boolean horizontal) Constructs a PathfinderLookAtEntity.- Parameters:
m- Mob to usefilter- Filter class to look atlookRange- Range of blocks to find selected class filterprobability- Probability (0.0 - 1.0) to look at something. Called every tick, recommended to be a low number. SeeDEFAULT_PROBABILITY.horizontal- Whether rotation should only be horizontal
-
-
Method Details
-
getRange
-
setRange
-
getProbability
public float getProbability()Description copied from interface:ProbableGet the current probability of this Pathfinder.- Specified by:
getProbabilityin interfaceProbable- Returns:
- Probability of this Pathfinder happening
-
setProbability
public void setProbability(float prob) Description copied from interface:ProbableSets the current probability of this Pathfinder.- Specified by:
setProbabilityin interfaceProbable- Parameters:
prob- Probability to set
-
setFilter
-
getFilter
-
isHorizontal
public boolean isHorizontal()Whether the Looking Rotation is only horizontal.- Returns:
- true if rotation is only horizontal, else false
-
setHorizontal
public void setHorizontal(boolean horizontal) Sets whether the Looking Rotation is only horizontal.- Parameters:
horizontal- true if rotation is only horizontal, else false
-
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
-