Class LookTargetUtil
java.lang.Object
net.minecraft.entity.ai.brain.task.LookTargetUtil
public class LookTargetUtil extends Object
-
Constructor Summary
Constructors Constructor Description LookTargetUtil() -
Method Summary
Modifier and Type Method Description private static booleancanSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> filter)static booleancanSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, EntityType<?> entityType)static booleancanSee(Brain<?> brain, LivingEntity target)static LivingEntitygetCloserEntity(LivingEntity source, Optional<LivingEntity> first, LivingEntity second)static LivingEntitygetCloserEntity(LivingEntity source, LivingEntity first, LivingEntity second)static Optional<LivingEntity>getEntity(LivingEntity entity, MemoryModuleType<UUID> uuidMemoryModule)static ChunkSectionPosgetPosClosestToOccupiedPointOfInterest(ServerWorld world, ChunkSectionPos center, int radius)static voidgive(LivingEntity entity, ItemStack stack, Vec3d targetLocation)static booleanisNewTargetTooFar(LivingEntity source, LivingEntity target, double extraDistance)Checks if an entity can be a new attack target for the source entity.static booleanisVisibleInMemory(LivingEntity source, LivingEntity target)static voidlookAt(LivingEntity entity, LivingEntity target)static voidlookAtAndWalkTowardsEachOther(LivingEntity first, LivingEntity second, float speed)private static voidlookAtEachOther(LivingEntity first, LivingEntity second)static booleanmethod_25940(MobEntity mobEntity, LivingEntity livingEntity, int int2)static booleanmethod_25941(MobEntity mobEntity, LivingEntity livingEntity)static Vec3dmethod_33193(PathAwareEntity pathAwareEntity, int int2, int int3)static Stream<VillagerEntity>streamSeenVillagers(VillagerEntity villager, Predicate<VillagerEntity> filter)static voidwalkTowards(LivingEntity entity, Entity target, float speed, int completionRange)static voidwalkTowards(LivingEntity entity, BlockPos target, float speed, int completionRange)private static voidwalkTowardsEachOther(LivingEntity first, LivingEntity second, float speed)
-
Constructor Details
-
LookTargetUtil
public LookTargetUtil()
-
-
Method Details
-
lookAtAndWalkTowardsEachOther
public static void lookAtAndWalkTowardsEachOther(LivingEntity first, LivingEntity second, float speed) -
canSee
-
canSee
public static boolean canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, EntityType<?> entityType) -
canSee
private static boolean canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> filter) -
lookAtEachOther
-
lookAt
-
walkTowardsEachOther
-
walkTowards
public static void walkTowards(LivingEntity entity, Entity target, float speed, int completionRange) -
walkTowards
public static void walkTowards(LivingEntity entity, BlockPos target, float speed, int completionRange) -
give
-
getPosClosestToOccupiedPointOfInterest
public static ChunkSectionPos getPosClosestToOccupiedPointOfInterest(ServerWorld world, ChunkSectionPos center, int radius) -
method_25940
-
method_25941
-
isNewTargetTooFar
public static boolean isNewTargetTooFar(LivingEntity source, LivingEntity target, double extraDistance)Checks if an entity can be a new attack target for the source entity.- Parameters:
source- the source entitytarget- the attack target candidateextraDistance- the max distance this new target can be farther compared to the existing target
-
isVisibleInMemory
-
getCloserEntity
public static LivingEntity getCloserEntity(LivingEntity source, Optional<LivingEntity> first, LivingEntity second) -
getCloserEntity
public static LivingEntity getCloserEntity(LivingEntity source, LivingEntity first, LivingEntity second) -
getEntity
public static Optional<LivingEntity> getEntity(LivingEntity entity, MemoryModuleType<UUID> uuidMemoryModule) -
streamSeenVillagers
public static Stream<VillagerEntity> streamSeenVillagers(VillagerEntity villager, Predicate<VillagerEntity> filter) -
method_33193
-