Class VillagerHostilesSensor
- java.lang.Object
-
- net.minecraft.entity.ai.brain.sensor.Sensor<LivingEntity>
-
- net.minecraft.entity.ai.brain.sensor.VillagerHostilesSensor
-
public class VillagerHostilesSensor extends Sensor<LivingEntity>
-
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.collect.ImmutableMap<EntityType<?>,java.lang.Float>ACCEPTABLE_DISTANCE_FROM_HOSTILES
-
Constructor Summary
Constructors Constructor Description VillagerHostilesSensor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private intcompareMobDistance(LivingEntity p_220983_1_, LivingEntity p_220983_2_, LivingEntity p_220983_3_)protected voiddoTick(ServerWorld p_212872_1_, LivingEntity p_212872_2_)private java.util.Optional<LivingEntity>getNearestHostile(LivingEntity p_220989_1_)private java.util.Optional<java.util.List<LivingEntity>>getVisibleEntities(LivingEntity p_220990_1_)private booleanisClose(LivingEntity p_220987_1_, LivingEntity p_220987_2_)private booleanisHostile(LivingEntity p_220988_1_)java.util.Set<MemoryModuleType<?>>requires()-
Methods inherited from class net.minecraft.entity.ai.brain.sensor.Sensor
isEntityTargetable, tick
-
-
-
-
Field Detail
-
ACCEPTABLE_DISTANCE_FROM_HOSTILES
private static final com.google.common.collect.ImmutableMap<EntityType<?>,java.lang.Float> ACCEPTABLE_DISTANCE_FROM_HOSTILES
-
-
Method Detail
-
requires
public java.util.Set<MemoryModuleType<?>> requires()
- Specified by:
requiresin classSensor<LivingEntity>
-
doTick
protected void doTick(ServerWorld p_212872_1_, LivingEntity p_212872_2_)
- Specified by:
doTickin classSensor<LivingEntity>
-
getNearestHostile
private java.util.Optional<LivingEntity> getNearestHostile(LivingEntity p_220989_1_)
-
getVisibleEntities
private java.util.Optional<java.util.List<LivingEntity>> getVisibleEntities(LivingEntity p_220990_1_)
-
compareMobDistance
private int compareMobDistance(LivingEntity p_220983_1_, LivingEntity p_220983_2_, LivingEntity p_220983_3_)
-
isClose
private boolean isClose(LivingEntity p_220987_1_, LivingEntity p_220987_2_)
-
isHostile
private boolean isHostile(LivingEntity p_220988_1_)
-
-