Class HoglinAi
java.lang.Object
net.minecraft.world.entity.monster.hoglin.HoglinAi
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final UniformInt
private static final int
private static final int
private static final int
private static final int
private static final int
static final int
static final int
private static final int
private static final UniformInt
private static final float
private static final float
private static final float
private static final float
private static final float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
broadcastAttackTarget
(Hoglin p_34635_, LivingEntity p_34636_) private static void
broadcastRetreat
(Hoglin p_34606_, LivingEntity p_34607_) private static Optional<? extends LivingEntity>
findNearestValidAttackTarget
(Hoglin p_34611_) private static SoundEvent
getSoundForActivity
(Hoglin p_34583_, Activity p_34584_) static Optional<SoundEvent>
getSoundForCurrentActivity
(Hoglin p_34594_) getVisibleAdultHoglins
(Hoglin p_34628_) private static void
initCoreActivity
(Brain<Hoglin> p_34592_) private static void
initFightActivity
(Brain<Hoglin> p_34609_) private static void
initIdleActivity
(Brain<Hoglin> p_34602_) private static void
initRetreatActivity
(Brain<Hoglin> p_34616_) private static boolean
isBreeding
(Hoglin p_34638_) private static boolean
isNearRepellent
(Hoglin p_34633_) protected static boolean
isPacified
(Hoglin p_34604_) (package private) static boolean
isPosNearNearestRepellent
(Hoglin p_34586_, BlockPos p_34587_) protected static Brain<?>
private static void
maybeRetaliate
(Hoglin p_34625_, LivingEntity p_34626_) protected static void
onHitTarget
(Hoglin p_34580_, LivingEntity p_34581_) private static boolean
piglinsOutnumberHoglins
(Hoglin p_34623_) private static void
retreatFromNearestTarget
(Hoglin p_34613_, LivingEntity p_34614_) private static void
setAttackTarget
(Hoglin p_34630_, LivingEntity p_34631_) private static void
setAttackTargetIfCloserThanCurrent
(Hoglin p_34640_, LivingEntity p_34641_) private static void
setAvoidTarget
(Hoglin p_34620_, LivingEntity p_34621_) protected static void
updateActivity
(Hoglin p_34578_) private static boolean
wantsToStopFleeing
(Hoglin p_34618_) protected static void
wasHurtBy
(Hoglin p_34596_, LivingEntity p_34597_)
-
Field Details
-
REPELLENT_DETECTION_RANGE_HORIZONTAL
public static final int REPELLENT_DETECTION_RANGE_HORIZONTAL- See Also:
-
REPELLENT_DETECTION_RANGE_VERTICAL
public static final int REPELLENT_DETECTION_RANGE_VERTICAL- See Also:
-
RETREAT_DURATION
-
ATTACK_DURATION
private static final int ATTACK_DURATION- See Also:
-
DESIRED_DISTANCE_FROM_PIGLIN_WHEN_IDLING
private static final int DESIRED_DISTANCE_FROM_PIGLIN_WHEN_IDLING- See Also:
-
DESIRED_DISTANCE_FROM_PIGLIN_WHEN_RETREATING
private static final int DESIRED_DISTANCE_FROM_PIGLIN_WHEN_RETREATING- See Also:
-
ATTACK_INTERVAL
private static final int ATTACK_INTERVAL- See Also:
-
BABY_ATTACK_INTERVAL
private static final int BABY_ATTACK_INTERVAL- See Also:
-
REPELLENT_PACIFY_TIME
private static final int REPELLENT_PACIFY_TIME- See Also:
-
ADULT_FOLLOW_RANGE
-
SPEED_MULTIPLIER_WHEN_AVOIDING_REPELLENT
private static final float SPEED_MULTIPLIER_WHEN_AVOIDING_REPELLENT- See Also:
-
SPEED_MULTIPLIER_WHEN_RETREATING
private static final float SPEED_MULTIPLIER_WHEN_RETREATING- See Also:
-
SPEED_MULTIPLIER_WHEN_MAKING_LOVE
private static final float SPEED_MULTIPLIER_WHEN_MAKING_LOVE- See Also:
-
SPEED_MULTIPLIER_WHEN_IDLING
private static final float SPEED_MULTIPLIER_WHEN_IDLING- See Also:
-
SPEED_MULTIPLIER_WHEN_FOLLOWING_ADULT
private static final float SPEED_MULTIPLIER_WHEN_FOLLOWING_ADULT- See Also:
-
-
Constructor Details
-
HoglinAi
public HoglinAi()
-
-
Method Details
-
makeBrain
-
initCoreActivity
-
initIdleActivity
-
initFightActivity
-
initRetreatActivity
-
createIdleMovementBehaviors
-
updateActivity
-
onHitTarget
-
broadcastRetreat
-
retreatFromNearestTarget
-
setAvoidTarget
-
findNearestValidAttackTarget
-
isPosNearNearestRepellent
-
wantsToStopFleeing
-
piglinsOutnumberHoglins
-
wasHurtBy
-
maybeRetaliate
-
setAttackTarget
-
broadcastAttackTarget
-
setAttackTargetIfCloserThanCurrent
-
getSoundForCurrentActivity
-
getSoundForActivity
-
getVisibleAdultHoglins
-
isNearRepellent
-
isBreeding
-
isPacified
-