public class VillagerHostilesSensor extends Sensor<LivingEntity>
| Modifier and Type | Field and Description |
|---|---|
private static ImmutableMap<EntityType<?>,Float> |
SQUARED_DISTANCES_FOR_DANGER |
| Constructor and Description |
|---|
VillagerHostilesSensor() |
| Modifier and Type | Method and Description |
|---|---|
private int |
compareDistances(LivingEntity entity,
LivingEntity hostile1,
LivingEntity hostile2) |
private Optional<LivingEntity> |
getNearestHostile(LivingEntity entity) |
Set<MemoryModuleType<?>> |
getOutputMemoryModules() |
private Optional<List<LivingEntity>> |
getVisibleMobs(LivingEntity entity) |
private boolean |
isCloseEnoughForDanger(LivingEntity entity,
LivingEntity hostile) |
private boolean |
isHostile(LivingEntity entity) |
protected void |
sense(ServerWorld world,
LivingEntity entity) |
method_30954, tickprivate static final ImmutableMap<EntityType<?>,Float> SQUARED_DISTANCES_FOR_DANGER
public Set<MemoryModuleType<?>> getOutputMemoryModules()
getOutputMemoryModules in class Sensor<LivingEntity>protected void sense(ServerWorld world, LivingEntity entity)
sense in class Sensor<LivingEntity>private Optional<LivingEntity> getNearestHostile(LivingEntity entity)
private Optional<List<LivingEntity>> getVisibleMobs(LivingEntity entity)
private int compareDistances(LivingEntity entity, LivingEntity hostile1, LivingEntity hostile2)
private boolean isCloseEnoughForDanger(LivingEntity entity, LivingEntity hostile)
private boolean isHostile(LivingEntity entity)