Class EntityAICitizenAvoidEntity
java.lang.Object
com.minecolonies.core.entity.ai.minimal.EntityAICitizenAvoidEntity
- All Implemented Interfaces:
IStateAI
AI task to avoid an Entity class.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionEntityAICitizenAvoidEntity(@NotNull EntityCitizen entity, @NotNull Class<? extends net.minecraft.world.entity.Entity> targetEntityClass, float distanceFromEntity, double farSpeed, double nearSpeed) Constructor. -
Method Summary
-
Constructor Details
-
EntityAICitizenAvoidEntity
public EntityAICitizenAvoidEntity(@NotNull @NotNull EntityCitizen entity, @NotNull @NotNull Class<? extends net.minecraft.world.entity.Entity> targetEntityClass, float distanceFromEntity, double farSpeed, double nearSpeed) Constructor.- Parameters:
entity- current entity.targetEntityClass- entity class we want to avoid.distanceFromEntity- how far we want to stay away.farSpeed- how fast we should move when we are far away.nearSpeed- how fast we should move when we are close.
-
-
Method Details
-
isEntityClose
Check for close entities- Returns:
- true if we should flee
-
reset
public void reset()Resets the task.
-