public class AnimalMateGoal extends Goal
Goal.Control
Modifier and Type | Field and Description |
---|---|
protected AnimalEntity |
animal |
private double |
chance |
private Class<? extends AnimalEntity> |
entityClass |
protected AnimalEntity |
mate |
private int |
timer |
private static TargetPredicate |
VALID_MATE_PREDICATE |
protected World |
world |
Constructor and Description |
---|
AnimalMateGoal(AnimalEntity animal,
double chance) |
AnimalMateGoal(AnimalEntity animal,
double chance,
Class<? extends AnimalEntity> entityClass) |
Modifier and Type | Method and Description |
---|---|
protected void |
breed() |
boolean |
canStart() |
private AnimalEntity |
findMate() |
boolean |
shouldContinue() |
void |
stop() |
void |
tick() |
canStop, getControls, setControls, start, toString
private static final TargetPredicate VALID_MATE_PREDICATE
protected final AnimalEntity animal
private final Class<? extends AnimalEntity> entityClass
protected final World world
protected AnimalEntity mate
private int timer
private final double chance
public AnimalMateGoal(AnimalEntity animal, double chance)
public AnimalMateGoal(AnimalEntity animal, double chance, Class<? extends AnimalEntity> entityClass)
public boolean shouldContinue()
shouldContinue
in class Goal
@Nullable private AnimalEntity findMate()
protected void breed()