Package com.pixelmonmod.pixelmon.ai
Class TargetNearestGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
com.pixelmonmod.pixelmon.ai.TargetGoal
com.pixelmonmod.pixelmon.ai.TargetNearestGoal
- Direct Known Subclasses:
TargetNearestGoalInFieldOfView
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.Goal.Flag
-
Field Summary
Fields inherited from class com.pixelmonmod.pixelmon.ai.TargetGoal
shouldCheckSight, targetDistance, taskOwner
-
Constructor Summary
ConstructorDescriptionTargetNearestGoal
(net.minecraft.world.entity.Mob entity, float targetRange, boolean shouldCheckSight) TargetNearestGoal
(net.minecraft.world.entity.Mob entity, float targetRange, boolean shouldCheckSight, boolean mustReach) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether an in-progress EntityAIBase should continue executing.boolean
canUse()
Returns whether the EntityAIBase should begin execution.void
setTargetDistance
(float targetDistance) void
start()
Execute a one shot task or start executing a continuous taskvoid
stop()
Resets the task.void
tick()
Methods inherited from class com.pixelmonmod.pixelmon.ai.TargetGoal
isSuitableTarget
Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, toString
-
Constructor Details
-
TargetNearestGoal
public TargetNearestGoal(net.minecraft.world.entity.Mob entity, float targetRange, boolean shouldCheckSight) -
TargetNearestGoal
public TargetNearestGoal(net.minecraft.world.entity.Mob entity, float targetRange, boolean shouldCheckSight, boolean mustReach)
-
-
Method Details
-
setTargetDistance
public void setTargetDistance(float targetDistance) -
canUse
public boolean canUse()Returns whether the EntityAIBase should begin execution.- Specified by:
canUse
in classnet.minecraft.world.entity.ai.goal.Goal
-
start
public void start()Execute a one shot task or start executing a continuous task- Overrides:
start
in classTargetGoal
-
tick
public void tick()- Overrides:
tick
in classTargetGoal
-
stop
public void stop()Description copied from class:TargetGoal
Resets the task.- Overrides:
stop
in classTargetGoal
-
canContinueToUse
public boolean canContinueToUse()Description copied from class:TargetGoal
Returns whether an in-progress EntityAIBase should continue executing.- Overrides:
canContinueToUse
in classTargetGoal
- Returns:
- Whether an in-progress EntityAIBase should continue executing.
-