类 BehaviorUtils
java.lang.Object
net.minecraft.world.entity.ai.behavior.BehaviorUtils
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static boolean
canSee
(LivingEntity pLivingEntity, LivingEntity pTarget) static boolean
entityIsVisible
(Brain<?> pBrain, LivingEntity pTarget) static SectionPos
findSectionClosestToVillage
(ServerLevel pServerLevel, SectionPos pSectionPos, int pRadius) static Optional<LivingEntity>
getLivingEntityFromUUIDMemory
(LivingEntity pLivingEntity, MemoryModuleType<UUID> pTargetMemory) static LivingEntity
getNearestTarget
(LivingEntity pCenterEntity, Optional<LivingEntity> pOptionalEntity, LivingEntity pLivingEntity) static Vec3
getRandomSwimmablePos
(PathfinderMob pPathfinder, int pRadius, int pVerticalDistance) static LivingEntity
getTargetNearestMe
(LivingEntity pCenterEntity, LivingEntity pLivingEntity1, LivingEntity pLivingEntity2) static boolean
isBreeding
(LivingEntity pEntity) static boolean
isOtherTargetMuchFurtherAwayThanCurrentAttackTarget
(LivingEntity pLivingEntity, LivingEntity pTarget, double pDistance) static boolean
isWithinAttackRange
(Mob pMob, LivingEntity pTarget, int pCooldown) static void
lockGazeAndWalkToEachOther
(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed) private static void
lookAtEachOther
(LivingEntity pFirstEntity, LivingEntity pSecondEntity) static void
lookAtEntity
(LivingEntity pEntity, LivingEntity pTarget) static void
setWalkAndLookTargetMemories
(LivingEntity pLivingEntity, BlockPos pPos, float pSpeed, int pDistance) static void
setWalkAndLookTargetMemories
(LivingEntity pEntity, PositionTracker pPositionTracker, float pSpeedModifier, int pCloseEnoughDist) static void
setWalkAndLookTargetMemories
(LivingEntity pLivingEntity, Entity pTarget, float pSpeed, int pDistance) private static void
setWalkAndLookTargetMemoriesToEachOther
(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed) private static boolean
targetIsValid
(Brain<?> pBrain, MemoryModuleType<? extends LivingEntity> pMemoryType, Predicate<LivingEntity> pLivingPredicate) static boolean
targetIsValid
(Brain<?> pBrains, MemoryModuleType<? extends LivingEntity> pMemorymodule, EntityType<?> pEntityType) static void
throwItem
(LivingEntity pLivingEntity, ItemStack pStack, Vec3 pOffset) static void
throwItem
(LivingEntity pEntity, ItemStack pStack, Vec3 pOffset, Vec3 pSpeedMultiplier, float pYOffset)
-
构造器详细资料
-
BehaviorUtils
private BehaviorUtils()
-
-
方法详细资料
-
lockGazeAndWalkToEachOther
public static void lockGazeAndWalkToEachOther(LivingEntity pFirstEntity, LivingEntity pSecondEntity, float pSpeed) -
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) -
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
-