Class BehaviorUtils
java.lang.Object
net.minecraft.world.entity.ai.behavior.BehaviorUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canSee
(LivingEntity p_22668_, LivingEntity p_22669_) static boolean
entityIsVisible
(Brain<?> p_22637_, LivingEntity p_22638_) static SectionPos
findSectionClosestToVillage
(ServerLevel p_22582_, SectionPos p_22583_, int p_22584_) static Optional
<LivingEntity> getLivingEntityFromUUIDMemory
(LivingEntity p_22611_, MemoryModuleType<UUID> p_22612_) static LivingEntity
getNearestTarget
(LivingEntity p_22626_, Optional<LivingEntity> p_22627_, LivingEntity p_22628_) static Vec3
getRandomSwimmablePos
(PathfinderMob p_147445_, int p_147446_, int p_147447_) static LivingEntity
getTargetNearestMe
(LivingEntity p_22607_, LivingEntity p_22608_, LivingEntity p_22609_) static boolean
isBreeding
(LivingEntity p_217127_) static boolean
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
(LivingEntity p_22599_, LivingEntity p_22600_, double p_22601_) static boolean
isWithinAttackRange
(Mob p_22633_, LivingEntity p_22634_, int p_22635_) static void
lockGazeAndWalkToEachOther
(LivingEntity p_22603_, LivingEntity p_22604_, float p_22605_, int p_332499_) private static void
lookAtEachOther
(LivingEntity p_22671_, LivingEntity p_22672_) static void
lookAtEntity
(LivingEntity p_22596_, LivingEntity p_22597_) static void
setWalkAndLookTargetMemories
(LivingEntity p_22618_, BlockPos p_22619_, float p_22620_, int p_22621_) static void
setWalkAndLookTargetMemories
(LivingEntity p_217129_, PositionTracker p_217130_, float p_217131_, int p_217132_) static void
setWalkAndLookTargetMemories
(LivingEntity p_22591_, Entity p_22592_, float p_22593_, int p_22594_) private static void
setWalkAndLookTargetMemoriesToEachOther
(LivingEntity p_22661_, LivingEntity p_22662_, float p_22663_, int p_332586_) private static boolean
targetIsValid
(Brain<?> p_22644_, MemoryModuleType<? extends LivingEntity> p_22645_, Predicate<LivingEntity> p_22646_) static boolean
targetIsValid
(Brain<?> p_22640_, MemoryModuleType<? extends LivingEntity> p_22641_, EntityType<?> p_22642_) static void
throwItem
(LivingEntity p_22614_, ItemStack p_22615_, Vec3 p_22616_) static void
throwItem
(LivingEntity p_217134_, ItemStack p_217135_, Vec3 p_217136_, Vec3 p_217137_, float p_217138_)
-
Constructor Details
-
BehaviorUtils
private BehaviorUtils()
-
-
Method Details
-
lockGazeAndWalkToEachOther
public static void lockGazeAndWalkToEachOther(LivingEntity p_22603_, LivingEntity p_22604_, float p_22605_, int p_332499_) -
entityIsVisible
-
targetIsValid
public static boolean targetIsValid(Brain<?> p_22640_, MemoryModuleType<? extends LivingEntity> p_22641_, EntityType<?> p_22642_) -
targetIsValid
private static boolean targetIsValid(Brain<?> p_22644_, MemoryModuleType<? extends LivingEntity> p_22645_, Predicate<LivingEntity> p_22646_) -
lookAtEachOther
-
lookAtEntity
-
setWalkAndLookTargetMemoriesToEachOther
private static void setWalkAndLookTargetMemoriesToEachOther(LivingEntity p_22661_, LivingEntity p_22662_, float p_22663_, int p_332586_) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity p_22591_, Entity p_22592_, float p_22593_, int p_22594_) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity p_22618_, BlockPos p_22619_, float p_22620_, int p_22621_) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity p_217129_, PositionTracker p_217130_, float p_217131_, int p_217132_) -
throwItem
-
throwItem
public static void throwItem(LivingEntity p_217134_, ItemStack p_217135_, Vec3 p_217136_, Vec3 p_217137_, float p_217138_) -
findSectionClosestToVillage
public static SectionPos findSectionClosestToVillage(ServerLevel p_22582_, SectionPos p_22583_, int p_22584_) -
isWithinAttackRange
-
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
public static boolean isOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity p_22599_, LivingEntity p_22600_, double p_22601_) -
canSee
-
getNearestTarget
public static LivingEntity getNearestTarget(LivingEntity p_22626_, Optional<LivingEntity> p_22627_, LivingEntity p_22628_) -
getTargetNearestMe
public static LivingEntity getTargetNearestMe(LivingEntity p_22607_, LivingEntity p_22608_, LivingEntity p_22609_) -
getLivingEntityFromUUIDMemory
public static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity p_22611_, MemoryModuleType<UUID> p_22612_) -
getRandomSwimmablePos
@Nullable public static Vec3 getRandomSwimmablePos(PathfinderMob p_147445_, int p_147446_, int p_147447_) -
isBreeding
-