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 boolean
canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> filter)
static boolean
canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, EntityType<?> entityType)
static boolean
canSee(Brain<?> brain, LivingEntity target)
static LivingEntity
getCloserEntity(LivingEntity source, Optional<LivingEntity> first, LivingEntity second)
static LivingEntity
getCloserEntity(LivingEntity source, LivingEntity first, LivingEntity second)
static Optional<LivingEntity>
getEntity(LivingEntity entity, MemoryModuleType<UUID> uuidMemoryModule)
static ChunkSectionPos
getPosClosestToOccupiedPointOfInterest(ServerWorld world, ChunkSectionPos center, int radius)
static void
give(LivingEntity entity, ItemStack stack, Vec3d targetLocation)
static boolean
isNewTargetTooFar(LivingEntity source, LivingEntity target, double extraDistance)
Checks if an entity can be a new attack target for the source entity.static boolean
isVisibleInMemory(LivingEntity source, LivingEntity target)
static void
lookAt(LivingEntity entity, LivingEntity target)
static void
lookAtAndWalkTowardsEachOther(LivingEntity first, LivingEntity second, float speed)
private static void
lookAtEachOther(LivingEntity first, LivingEntity second)
static boolean
method_25940(MobEntity mobEntity, LivingEntity livingEntity, int int2)
static boolean
method_25941(MobEntity mobEntity, LivingEntity livingEntity)
static Vec3d
method_33193(PathAwareEntity pathAwareEntity, int int2, int int3)
static Stream<VillagerEntity>
streamSeenVillagers(VillagerEntity villager, Predicate<VillagerEntity> filter)
static void
walkTowards(LivingEntity entity, Entity target, float speed, int completionRange)
static void
walkTowards(LivingEntity entity, BlockPos target, float speed, int completionRange)
private static void
walkTowardsEachOther(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
-