Class BehaviorUtils
java.lang.Object
net.minecraft.world.entity.ai.behavior.BehaviorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanSee(LivingEntity body, LivingEntity target) static booleanentityIsVisible(Brain<?> brain, LivingEntity targetEntity) static SectionPosfindSectionClosestToVillage(ServerLevel level, SectionPos center, int radius) static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity body, MemoryModuleType<UUID> memoryType) static LivingEntitygetNearestTarget(LivingEntity body, Optional<LivingEntity> target1, LivingEntity target2) static @Nullable Vec3getRandomSwimmablePos(PathfinderMob body, int maxHorizontalDistance, int maxVerticalDistance) static LivingEntitygetTargetNearestMe(LivingEntity body, LivingEntity target1, LivingEntity target2) static booleanisBreeding(LivingEntity body) static booleanisOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity body, LivingEntity otherTarget, double howMuchFurtherAway) static booleanisWithinAttackRange(Mob body, LivingEntity target, int projectileAttackRangeMargin) static voidlockGazeAndWalkToEachOther(LivingEntity entity1, LivingEntity entity2, float speedModifier, int closeEnoughDistance) private static voidlookAtEachOther(LivingEntity entity1, LivingEntity entity2) static voidlookAtEntity(LivingEntity looker, LivingEntity targetEntity) static voidsetWalkAndLookTargetMemories(LivingEntity walker, BlockPos targetPos, float speedModifier, int closeEnoughDistance) static voidsetWalkAndLookTargetMemories(LivingEntity walker, PositionTracker target, float speedModifier, int closeEnoughDistance) static voidsetWalkAndLookTargetMemories(LivingEntity walker, Entity targetEntity, float speedModifier, int closeEnoughDistance) private static voidsetWalkAndLookTargetMemoriesToEachOther(LivingEntity entity1, LivingEntity entity2, float speedModifier, int closeEnoughDistance) private static booleantargetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memory, Predicate<LivingEntity> targetPredicate) static booleantargetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memory, EntityType<?> targetType) static voidthrowItem(LivingEntity thrower, ItemStack item, Vec3 targetPos) static voidthrowItem(LivingEntity thrower, ItemStack item, Vec3 targetPos, Vec3 throwVelocity, float handYDistanceFromEye)
-
Constructor Details
-
BehaviorUtils
private BehaviorUtils()
-
-
Method Details
-
lockGazeAndWalkToEachOther
public static void lockGazeAndWalkToEachOther(LivingEntity entity1, LivingEntity entity2, float speedModifier, int closeEnoughDistance) -
entityIsVisible
-
targetIsValid
public static boolean targetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memory, EntityType<?> targetType) -
targetIsValid
private static boolean targetIsValid(Brain<?> brain, MemoryModuleType<? extends LivingEntity> memory, Predicate<LivingEntity> targetPredicate) -
lookAtEachOther
-
lookAtEntity
-
setWalkAndLookTargetMemoriesToEachOther
private static void setWalkAndLookTargetMemoriesToEachOther(LivingEntity entity1, LivingEntity entity2, float speedModifier, int closeEnoughDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity walker, Entity targetEntity, float speedModifier, int closeEnoughDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity walker, BlockPos targetPos, float speedModifier, int closeEnoughDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity walker, PositionTracker target, float speedModifier, int closeEnoughDistance) -
throwItem
-
throwItem
public static void throwItem(LivingEntity thrower, ItemStack item, Vec3 targetPos, Vec3 throwVelocity, float handYDistanceFromEye) -
findSectionClosestToVillage
public static SectionPos findSectionClosestToVillage(ServerLevel level, SectionPos center, int radius) -
isWithinAttackRange
public static boolean isWithinAttackRange(Mob body, LivingEntity target, int projectileAttackRangeMargin) -
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
public static boolean isOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity body, LivingEntity otherTarget, double howMuchFurtherAway) -
canSee
-
getNearestTarget
public static LivingEntity getNearestTarget(LivingEntity body, Optional<LivingEntity> target1, LivingEntity target2) -
getTargetNearestMe
public static LivingEntity getTargetNearestMe(LivingEntity body, LivingEntity target1, LivingEntity target2) -
getLivingEntityFromUUIDMemory
public static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity body, MemoryModuleType<UUID> memoryType) -
getRandomSwimmablePos
public static @Nullable Vec3 getRandomSwimmablePos(PathfinderMob body, int maxHorizontalDistance, int maxVerticalDistance) -
isBreeding
-