Class EntityAICitizenAvoidEntity

java.lang.Object
com.minecolonies.core.entity.ai.minimal.EntityAICitizenAvoidEntity
All Implemented Interfaces:
IStateAI

public class EntityAICitizenAvoidEntity extends Object implements IStateAI
AI task to avoid an Entity class.
  • 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

      public IState isEntityClose()
      Check for close entities
      Returns:
      true if we should flee
    • reset

      public void reset()
      Resets the task.