Package me.gamercoder215.mobchip.ai.goal
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
public final 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 me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final float
Default Probability to look at an Entity (0.02F)Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
Fields inherited from interface me.gamercoder215.mobchip.ai.goal.Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGE
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PathfinderLookAtEntity with the defaultRanged.DEFAULT_LOOK_RANGE
.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.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.float
Get the current probability of this Pathfinder.float
getRange()
Gets the current Range.boolean
Whether the Looking Rotation is only horizontal.void
Set the Filter that this Pathfinder is looking for.void
setHorizontal
(boolean horizontal) Sets whether the Looking Rotation is only horizontal.void
setProbability
(float prob) Sets the current probability of this Pathfinder.void
setRange
(float range) Sets the current Range.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
-
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
public PathfinderLookAtEntity(@NotNull @NotNull Mob m, @NotNull @NotNull Class<T> filter, float lookRange) Constructs a PathfinderLookAtEntity with the default probability.- Parameters:
m
- Mob to usefilter
- Filter class to look atlookRange
- Range of blocks to find selected class filter
-
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
public float getRange()Description copied from interface:Ranged
Gets the current Range. -
setRange
public void setRange(float range) Description copied from interface:Ranged
Sets the current Range. -
getProbability
public float getProbability()Description copied from interface:Probable
Get the current probability of this Pathfinder.- Specified by:
getProbability
in interfaceProbable
- Returns:
- Probability of this Pathfinder happening
-
setProbability
public void setProbability(float prob) Description copied from interface:Probable
Sets the current probability of this Pathfinder.- Specified by:
setProbability
in interfaceProbable
- Parameters:
prob
- Probability to set
-
setFilter
Description copied from interface:Filtering
Set the Filter that this Pathfinder is looking for.- Specified by:
setFilter
in interfaceFiltering<T extends LivingEntity>
- Parameters:
clazz
- Filter to set
-
getFilter
Description copied from interface:Filtering
Get the filter that this Pathfinder is looking for.- Specified by:
getFilter
in interfaceFiltering<T extends LivingEntity>
- Returns:
- Filter found
-
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: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
-