Class BehaviorUtils
java.lang.Object
net.minecraft.world.entity.ai.behavior.BehaviorUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanSee(LivingEntity pLivingEntity, LivingEntity pTarget) static booleanentityIsVisible(Brain<?> pBrain, LivingEntity pTarget) static SectionPosfindSectionClosestToVillage(ServerLevel pServerLevel, SectionPos pSectionPos, int pRadius) static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity pLivingEntity, MemoryModuleType<UUID> pTargetMemory) static LivingEntitygetNearestTarget(LivingEntity pCenterEntity, Optional<LivingEntity> pOptionalEntity, LivingEntity pLivingEntity) static Vec3getRandomSwimmablePos(PathfinderMob pPathfinder, int pRadius, int pVerticalDistance) static LivingEntitygetTargetNearestMe(LivingEntity pCenterEntity, LivingEntity pLivingEntity1, LivingEntity pLivingEntity2) static booleanisBreeding(LivingEntity pEntity) static booleanisOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity pLivingEntity, LivingEntity pTarget, double pDistance) static booleanisWithinAttackRange(Mob pMob, LivingEntity pTarget, int pCooldown) static voidlockGazeAndWalkToEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed, int pDistance) private static voidlookAtEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity) static voidlookAtEntity(LivingEntity pEntity, LivingEntity pTarget) static voidsetWalkAndLookTargetMemories(LivingEntity pLivingEntity, BlockPos pPos, float pSpeed, int pDistance) static voidsetWalkAndLookTargetMemories(LivingEntity pEntity, PositionTracker pPositionTracker, float pSpeedModifier, int pCloseEnoughDist) static voidsetWalkAndLookTargetMemories(LivingEntity pLivingEntity, Entity pTarget, float pSpeed, int pDistance) private static voidsetWalkAndLookTargetMemoriesToEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed, int pDistance) private static booleantargetIsValid(Brain<?> pBrain, MemoryModuleType<? extends LivingEntity> pMemoryType, Predicate<LivingEntity> pLivingPredicate) static booleantargetIsValid(Brain<?> pBrains, MemoryModuleType<? extends LivingEntity> pMemorymodule, EntityType<?> pEntityType) static voidthrowItem(LivingEntity pLivingEntity, ItemStack pStack, Vec3 pOffset) static voidthrowItem(LivingEntity pEntity, ItemStack pStack, Vec3 pOffset, Vec3 pSpeedMultiplier, float pYOffset)
-
Constructor Details
-
BehaviorUtils
private BehaviorUtils()
-
-
Method Details
-
lockGazeAndWalkToEachOther
public static void lockGazeAndWalkToEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed, int pDistance) -
entityIsVisible
-
targetIsValid
public static boolean targetIsValid(Brain<?> pBrains, MemoryModuleType<? extends LivingEntity> pMemorymodule, EntityType<?> pEntityType) -
targetIsValid
private static boolean targetIsValid(Brain<?> pBrain, MemoryModuleType<? extends LivingEntity> pMemoryType, Predicate<LivingEntity> pLivingPredicate) -
lookAtEachOther
-
lookAtEntity
-
setWalkAndLookTargetMemoriesToEachOther
private static void setWalkAndLookTargetMemoriesToEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed, int pDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity pLivingEntity, Entity pTarget, float pSpeed, int pDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity pLivingEntity, BlockPos pPos, float pSpeed, int pDistance) -
setWalkAndLookTargetMemories
public static void setWalkAndLookTargetMemories(LivingEntity pEntity, PositionTracker pPositionTracker, float pSpeedModifier, int pCloseEnoughDist) -
throwItem
-
throwItem
public static void throwItem(LivingEntity pEntity, ItemStack pStack, Vec3 pOffset, Vec3 pSpeedMultiplier, float pYOffset) -
findSectionClosestToVillage
public static SectionPos findSectionClosestToVillage(ServerLevel pServerLevel, SectionPos pSectionPos, int pRadius) -
isWithinAttackRange
-
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
public static boolean isOtherTargetMuchFurtherAwayThanCurrentAttackTarget(LivingEntity pLivingEntity, LivingEntity pTarget, double pDistance) -
canSee
-
getNearestTarget
public static LivingEntity getNearestTarget(LivingEntity pCenterEntity, Optional<LivingEntity> pOptionalEntity, LivingEntity pLivingEntity) -
getTargetNearestMe
public static LivingEntity getTargetNearestMe(LivingEntity pCenterEntity, LivingEntity pLivingEntity1, LivingEntity pLivingEntity2) -
getLivingEntityFromUUIDMemory
public static Optional<LivingEntity> getLivingEntityFromUUIDMemory(LivingEntity pLivingEntity, MemoryModuleType<UUID> pTargetMemory) -
getRandomSwimmablePos
@Nullable public static Vec3 getRandomSwimmablePos(PathfinderMob pPathfinder, int pRadius, int pVerticalDistance) -
isBreeding
-