public class LookTargetUtil extends Object
Constructor and Description |
---|
LookTargetUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canSee(Brain<?> brain,
LivingEntity target) |
static boolean |
canSee(Brain<?> brain,
MemoryModuleType<? extends LivingEntity> memoryModuleType,
EntityType<?> entityType) |
private static boolean |
canSee(Brain<?> brain,
MemoryModuleType<? extends LivingEntity> memoryType,
Predicate<LivingEntity> filter) |
static LivingEntity |
getCloserEntity(LivingEntity source,
LivingEntity first,
LivingEntity second) |
static LivingEntity |
getCloserEntity(LivingEntity source,
Optional<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(LivingEntity livingEntity,
LivingEntity livingEntity2) |
static Stream<VillagerEntity> |
streamSeenVillagers(VillagerEntity villager,
Predicate<VillagerEntity> filter) |
static void |
walkTowards(LivingEntity entity,
BlockPos target,
float speed,
int completionRange) |
static void |
walkTowards(LivingEntity entity,
Entity target,
float speed,
int completionRange) |
private static void |
walkTowardsEachOther(LivingEntity first,
LivingEntity second,
float speed) |
public static void lookAtAndWalkTowardsEachOther(LivingEntity first, LivingEntity second, float speed)
public static boolean canSee(Brain<?> brain, LivingEntity target)
public static boolean canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, EntityType<?> entityType)
private static boolean canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> filter)
private static void lookAtEachOther(LivingEntity first, LivingEntity second)
public static void lookAt(LivingEntity entity, LivingEntity target)
private static void walkTowardsEachOther(LivingEntity first, LivingEntity second, float speed)
public static void walkTowards(LivingEntity entity, Entity target, float speed, int completionRange)
public static void walkTowards(LivingEntity entity, BlockPos target, float speed, int completionRange)
public static void give(LivingEntity entity, ItemStack stack, Vec3d targetLocation)
public static ChunkSectionPos getPosClosestToOccupiedPointOfInterest(ServerWorld world, ChunkSectionPos center, int radius)
public static boolean method_25940(MobEntity mobEntity, LivingEntity livingEntity, int int2)
public static boolean method_25941(LivingEntity livingEntity, LivingEntity livingEntity2)
public static boolean isNewTargetTooFar(LivingEntity source, LivingEntity target, double extraDistance)
source
- the source entitytarget
- the attack target candidateextraDistance
- the max distance this new target can be farther compared to the existing targetpublic static boolean isVisibleInMemory(LivingEntity source, LivingEntity target)
public static LivingEntity getCloserEntity(LivingEntity source, Optional<LivingEntity> first, LivingEntity second)
public static LivingEntity getCloserEntity(LivingEntity source, LivingEntity first, LivingEntity second)
public static Optional<LivingEntity> getEntity(LivingEntity entity, MemoryModuleType<UUID> uuidMemoryModule)
public static Stream<VillagerEntity> streamSeenVillagers(VillagerEntity villager, Predicate<VillagerEntity> filter)