Class BehaviorUtils
java.lang.Object
net.minecraft.world.entity.ai.behavior.BehaviorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanSee(LivingEntity livingEntity, LivingEntity target) static booleanentityIsVisible(Brain<?> brain, LivingEntity target) static SectionPosfindSectionClosestToVillage(ServerLevel serverLevel, SectionPos sectionPos, int radius) static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity livingEntity, MemoryModuleType<UUID> targetMemory) static LivingEntitygetNearestTarget(LivingEntity centerEntity, Optional<LivingEntity> optionalEntity, LivingEntity livingEntity) static Vec3getRandomSwimmablePos(PathfinderMob pathfinder, int radius, int verticalDistance) static LivingEntitygetTargetNearestMe(LivingEntity centerEntity, LivingEntity livingEntity1, LivingEntity livingEntity2) static booleanisBreeding(LivingEntity entity) static booleanisOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity livingEntity, LivingEntity target, double distance) static booleanisWithinAttackRange(Mob mob, LivingEntity target, int cooldown) static voidlockGazeAndWalkToEachOther(LivingEntity firstEntity, LivingEntity secondEntity, float speed, int distance) private static voidlookAtEachOther(LivingEntity firstEntity, LivingEntity secondEntity) static voidlookAtEntity(LivingEntity entity, LivingEntity target) static voidsetWalkAndLookTargetMemories(LivingEntity livingEntity, BlockPos pos, float speed, int distance) static voidsetWalkAndLookTargetMemories(LivingEntity entity, PositionTracker positionTracker, float speedModifier, int closeEnoughDist) static voidsetWalkAndLookTargetMemories(LivingEntity livingEntity, Entity target, float speed, int distance) private static voidsetWalkAndLookTargetMemoriesToEachOther(LivingEntity firstEntity, LivingEntity secondEntity, float speed, int distance) private static booleantargetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> livingPredicate) static booleantargetIsValid(Brain<?> brains, MemoryModuleType<? extends LivingEntity> memorymodule, EntityType<?> entityType) static voidthrowItem(LivingEntity livingEntity, ItemStack stack, Vec3 offset) static voidthrowItem(LivingEntity entity, ItemStack stack, Vec3 offset, Vec3 speedMultiplier, float yOffset)
-
Constructor Details
-
BehaviorUtils
private BehaviorUtils()
-
-
Method Details
-
lockGazeAndWalkToEachOther
public static void lockGazeAndWalkToEachOther(LivingEntity firstEntity, LivingEntity secondEntity, float speed, int distance) -
entityIsVisible
-
targetIsValid
public static boolean targetIsValid(Brain<?> brains, MemoryModuleType<? extends LivingEntity> memorymodule, EntityType<?> entityType) -
targetIsValid
private static boolean targetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memoryType, Predicate<LivingEntity> livingPredicate) -
lookAtEachOther
-
lookAtEntity
-
setWalkAndLookTargetMemoriesToEachOther
private static void setWalkAndLookTargetMemoriesToEachOther(LivingEntity firstEntity, LivingEntity secondEntity, float speed, int distance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity livingEntity, Entity target, float speed, int distance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity livingEntity, BlockPos pos, float speed, int distance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity entity, PositionTracker positionTracker, float speedModifier, int closeEnoughDist) -
throwItem
-
throwItem
public static void throwItem(LivingEntity entity, ItemStack stack, Vec3 offset, Vec3 speedMultiplier, float yOffset) -
findSectionClosestToVillage
public static SectionPos findSectionClosestToVillage(ServerLevel serverLevel, SectionPos sectionPos, int radius) -
isWithinAttackRange
-
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
public static boolean isOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity livingEntity, LivingEntity target, double distance) -
canSee
-
getNearestTarget
public static LivingEntity getNearestTarget(LivingEntity centerEntity, Optional<LivingEntity> optionalEntity, LivingEntity livingEntity) -
getTargetNearestMe
public static LivingEntity getTargetNearestMe(LivingEntity centerEntity, LivingEntity livingEntity1, LivingEntity livingEntity2) -
getLivingEntityFromUUIDMemory
public static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity livingEntity, MemoryModuleType<UUID> targetMemory) -
getRandomSwimmablePos
@Nullable public static Vec3 getRandomSwimmablePos(PathfinderMob pathfinder, int radius, int verticalDistance) -
isBreeding
-