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
ConstructorsConstructorDescriptionTargetNearestGoal(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 TypeMethodDescriptionbooleanReturns whether an in-progress EntityAIBase should continue executing.booleancanUse()Returns whether the EntityAIBase should begin execution.voidsetTargetDistance(float targetDistance) voidstart()Execute a one shot task or start executing a continuous taskvoidstop()Resets the task.voidtick()Methods inherited from class com.pixelmonmod.pixelmon.ai.TargetGoal
isSuitableTargetMethods 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:
canUsein classnet.minecraft.world.entity.ai.goal.Goal
-
start
public void start()Execute a one shot task or start executing a continuous task- Overrides:
startin classTargetGoal
-
tick
public void tick()- Overrides:
tickin classTargetGoal
-
stop
public void stop()Description copied from class:TargetGoalResets the task.- Overrides:
stopin classTargetGoal
-
canContinueToUse
public boolean canContinueToUse()Description copied from class:TargetGoalReturns whether an in-progress EntityAIBase should continue executing.- Overrides:
canContinueToUsein classTargetGoal- Returns:
- Whether an in-progress EntityAIBase should continue executing.
-