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) |
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<DynamicSerializableUuid> uuidMemoryModule) |
static ChunkSectionPos |
getPosClosestToOccupiedPointOfInterest(ServerWorld world,
ChunkSectionPos center,
int radius) |
static void |
give(LivingEntity entity,
ItemStack stack,
Vec3d vec3d) |
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 float2) |
private static void |
lookAtEachOther(LivingEntity first,
LivingEntity second) |
private static boolean |
method_24564(Brain<?> brain,
MemoryModuleType<? extends LivingEntity> memoryModuleType,
Predicate<LivingEntity> predicate) |
static boolean |
method_25940(MobEntity mobEntity,
LivingEntity livingEntity,
int int2) |
static boolean |
method_25941(LivingEntity livingEntity,
LivingEntity livingEntity2) |
static void |
walkTowards(LivingEntity entity,
BlockPos target,
float float2,
int int2) |
static void |
walkTowards(LivingEntity entity,
Entity target,
float float2,
int int2) |
private static void |
walkTowards(LivingEntity entity,
LookTarget target,
float float2,
int int2) |
private static void |
walkTowardsEachOther(LivingEntity first,
LivingEntity second,
float float2) |
public static void lookAtAndWalkTowardsEachOther(LivingEntity first, LivingEntity second, float float2)
public static boolean canSee(Brain<?> brain, LivingEntity target)
public static boolean canSee(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, EntityType<?> entityType)
private static boolean method_24564(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryModuleType, Predicate<LivingEntity> predicate)
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 float2)
public static void walkTowards(LivingEntity entity, Entity target, float float2, int int2)
public static void walkTowards(LivingEntity entity, BlockPos target, float float2, int int2)
private static void walkTowards(LivingEntity entity, LookTarget target, float float2, int int2)
public static void give(LivingEntity entity, ItemStack stack, Vec3d vec3d)
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<DynamicSerializableUuid> uuidMemoryModule)