Package net.minecraft.entity.ai.goal
Class TemptGoal
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.TemptGoal
- Direct Known Subclasses:
CatEntity.TemptGoal,OcelotEntity.OcelotTemptGoal
public class TemptGoal extends Goal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.goal.Goal
Goal.Control -
Field Summary
Fields Modifier and Type Field Description private booleanactiveprivate booleancanBeScaredprotected PlayerEntityclosestPlayerprivate intcooldownprivate Ingredientfoodprivate doublelastPlayerPitchprivate doublelastPlayerXprivate doublelastPlayerYprivate doublelastPlayerYawprivate doublelastPlayerZprotected PathAwareEntitymobprivate doublespeedprivate static TargetPredicateTEMPTING_ENTITY_PREDICATE -
Constructor Summary
Constructors Constructor Description TemptGoal(PathAwareEntity mob, double speed, boolean canBeScared, Ingredient food)TemptGoal(PathAwareEntity mob, double speed, Ingredient food, boolean canBeScared) -
Method Summary
Modifier and Type Method Description protected booleancanBeScared()booleancanStart()booleanisActive()protected booleanisTemptedBy(ItemStack stack)booleanshouldContinue()voidstart()voidstop()voidtick()Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, toString
-
Field Details
-
TEMPTING_ENTITY_PREDICATE
-
mob
-
speed
private final double speed -
lastPlayerX
private double lastPlayerX -
lastPlayerY
private double lastPlayerY -
lastPlayerZ
private double lastPlayerZ -
lastPlayerPitch
private double lastPlayerPitch -
lastPlayerYaw
private double lastPlayerYaw -
closestPlayer
-
cooldown
private int cooldown -
active
private boolean active -
food
-
canBeScared
private final boolean canBeScared
-
-
Constructor Details
-
TemptGoal
-
TemptGoal
-
-
Method Details
-
canStart
public boolean canStart() -
isTemptedBy
-
shouldContinue
public boolean shouldContinue()- Overrides:
shouldContinuein classGoal
-
canBeScared
protected boolean canBeScared() -
start
public void start() -
stop
public void stop() -
tick
public void tick() -
isActive
public boolean isActive()
-