Class PiglinTasks
java.lang.Object
net.minecraft.entity.monster.piglin.PiglinTasks
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final RangedInteger
private static final RangedInteger
static final Item
private static final RangedInteger
private static final RangedInteger
private static final RangedInteger
private static final RangedInteger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static void
admireGoldItem
(LivingEntity p_234501_0_) static void
angerNearbyPiglins
(PlayerEntity p_234478_0_, boolean p_234478_1_) private static RunAwayTask<BlockPos>
private static PiglinIdleActivityTask<PiglinEntity,
LivingEntity> private static PiglinIdleActivityTask<PiglinEntity,
LivingEntity> private static RunSometimesTask<PiglinEntity>
protected static void
broadcastAngerTarget
(AbstractPiglinEntity p_234487_0_, LivingEntity p_234487_1_) protected static void
broadcastDontKillAnyMoreHoglinsForAWhile
(PiglinEntity p_234512_0_) private static void
broadcastRetreat
(PiglinEntity p_234516_0_, LivingEntity p_234516_1_) protected static void
broadcastUniversalAnger
(AbstractPiglinEntity p_241430_0_) protected static boolean
canAdmire
(PiglinEntity p_234489_0_, ItemStack p_234489_1_) protected static void
cancelAdmiring
(PiglinEntity p_234496_0_) private static FirstShuffledTask<PiglinEntity>
private static FirstShuffledTask<PiglinEntity>
private static boolean
doesntSeeAnyPlayerHoldingLovedItem
(LivingEntity p_234514_0_) protected static void
dontKillAnyMoreHoglinsForAWhile
(AbstractPiglinEntity p_234518_0_) private static void
eat
(PiglinEntity p_234536_0_) private static Optional<? extends LivingEntity>
findNearestValidAttackTarget
(PiglinEntity p_234526_0_) private static List<AbstractPiglinEntity>
getAdultPiglins
(AbstractPiglinEntity p_234530_0_) private static Optional<LivingEntity>
getAngerTarget
(AbstractPiglinEntity p_234532_0_) static Optional<LivingEntity>
getAvoidTarget
(PiglinEntity p_234515_0_) getBarterResponseItems
(PiglinEntity p_234524_0_) static Optional<PlayerEntity>
getNearestVisibleTargetablePlayer
(AbstractPiglinEntity p_241432_0_) private static Vector3d
getRandomNearbyPos
(PiglinEntity p_234537_0_) private static SoundEvent
getSoundForActivity
(PiglinEntity p_241422_0_, Activity p_241422_1_) static Optional<SoundEvent>
getSoundForCurrentActivity
(PiglinEntity p_241429_0_) private static List<AbstractPiglinEntity>
getVisibleAdultPiglins
(PiglinEntity p_234529_0_) protected static boolean
hasAnyoneNearbyHuntedRecently
(PiglinEntity p_234508_0_) private static boolean
hasCrossbow
(LivingEntity p_234494_0_) private static boolean
hasEatenRecently
(PiglinEntity p_234538_0_) private static boolean
hoglinsOutnumberPiglins
(PiglinEntity p_234535_0_) private static void
holdInOffhand
(PiglinEntity p_241427_0_, ItemStack p_241427_1_) private static void
initAdmireItemActivity
(Brain<PiglinEntity> p_234502_0_) private static void
initCelebrateActivity
(Brain<PiglinEntity> p_234495_0_) private static void
initCoreActivity
(Brain<PiglinEntity> p_234464_0_) private static void
initFightActivity
(PiglinEntity p_234488_0_, Brain<PiglinEntity> p_234488_1_) private static void
initIdleActivity
(Brain<PiglinEntity> p_234485_0_) protected static void
initMemories
(PiglinEntity p_234466_0_) private static void
initRetreatActivity
(Brain<PiglinEntity> p_234507_0_) private static void
initRideHoglinActivity
(Brain<PiglinEntity> p_234511_0_) private static boolean
isAdmiringDisabled
(PiglinEntity p_234453_0_) private static boolean
isAdmiringItem
(PiglinEntity p_234451_0_) private static boolean
isAttackAllowed
(LivingEntity p_234506_0_) private static boolean
isBabyRidingBaby
(PiglinEntity p_234522_0_) private static boolean
isBarterCurrency
(Item p_234492_0_) private static boolean
private static boolean
isHoldingItemInOffHand
(PiglinEntity p_234454_0_) protected static boolean
isIdle
(AbstractPiglinEntity p_234520_0_) protected static boolean
isLovedItem
(Item p_234480_0_) private static boolean
isNearAvoidTarget
(PiglinEntity p_234528_0_) private static boolean
isNearestValidAttackTarget
(PiglinEntity p_234504_0_, LivingEntity p_234504_1_) private static boolean
isNearRepellent
(PiglinEntity p_234452_0_) private static boolean
isNearZombified
(PiglinEntity p_234525_0_) private static boolean
isNotHoldingLovedItemInOffHand
(PiglinEntity p_234455_0_) static boolean
isPlayerHoldingLovedItem
(LivingEntity p_234482_0_) static boolean
isWearingGold
(LivingEntity p_234460_0_) static boolean
isZombified
(EntityType p_234459_0_) protected static Brain<?>
makeBrain
(PiglinEntity p_234469_0_, Brain<PiglinEntity> p_234469_1_) protected static void
maybeRetaliate
(AbstractPiglinEntity p_234509_0_, LivingEntity p_234509_1_) static ActionResultType
mobInteract
(PiglinEntity p_234471_0_, PlayerEntity p_234471_1_, Hand p_234471_2_) protected static void
pickUpItem
(PiglinEntity p_234470_0_, ItemEntity p_234470_1_) private static boolean
piglinsEqualOrOutnumberHoglins
(PiglinEntity p_234534_0_) private static void
putInInventory
(PiglinEntity p_234498_0_, ItemStack p_234498_1_) private static ItemStack
removeOneItemFromItemEntity
(ItemEntity p_234465_0_) private static void
retreatFromNearestTarget
(PiglinEntity p_234519_0_, LivingEntity p_234519_1_) private static boolean
seesPlayerHoldingLovedItem
(LivingEntity p_234510_0_) protected static void
setAngerTarget
(AbstractPiglinEntity p_234497_0_, LivingEntity p_234497_1_) private static void
setAngerTargetIfCloserThanCurrent
(AbstractPiglinEntity p_234513_0_, LivingEntity p_234513_1_) private static void
setAngerTargetToNearestTargetablePlayerIfFound
(AbstractPiglinEntity p_241431_0_, LivingEntity p_241431_1_) private static void
setAvoidTargetAndDontHuntForAWhile
(PiglinEntity p_234521_0_, LivingEntity p_234521_1_) protected static void
stopHoldingOffHandItem
(PiglinEntity p_234477_0_, boolean p_234477_1_) private static void
stopWalking
(PiglinEntity p_234531_0_) private static void
throwItems
(PiglinEntity p_234475_0_, List<ItemStack> p_234475_1_) private static void
throwItemsTowardPlayer
(PiglinEntity p_234472_0_, PlayerEntity p_234472_1_, List<ItemStack> p_234472_2_) private static void
throwItemsTowardPos
(PiglinEntity p_234476_0_, List<ItemStack> p_234476_1_, Vector3d p_234476_2_) private static void
throwItemsTowardRandomPos
(PiglinEntity p_234490_0_, List<ItemStack> p_234490_1_) protected static void
updateActivity
(PiglinEntity p_234486_0_) private static boolean
wantsToDance
(LivingEntity p_234461_0_, LivingEntity p_234461_1_) protected static boolean
wantsToPickup
(PiglinEntity p_234474_0_, ItemStack p_234474_1_) private static boolean
wantsToStopFleeing
(PiglinEntity p_234533_0_) private static boolean
wantsToStopRiding
(PiglinEntity p_234467_0_, Entity p_234467_1_) protected static void
wasHurtBy
(PiglinEntity p_234468_0_, LivingEntity p_234468_1_) private static boolean
wasHurtRecently
(LivingEntity p_234517_0_)
-
Field Details
-
BARTERING_ITEM
-
TIME_BETWEEN_HUNTS
-
RIDE_START_INTERVAL
-
RIDE_DURATION
-
RETREAT_DURATION
-
AVOID_ZOMBIFIED_DURATION
-
BABY_AVOID_NEMESIS_DURATION
-
FOOD_ITEMS
-
-
Constructor Details
-
PiglinTasks
public PiglinTasks()
-
-
Method Details
-
makeBrain
-
initMemories
-
initCoreActivity
-
initIdleActivity
-
initFightActivity
-
initCelebrateActivity
-
initAdmireItemActivity
-
initRetreatActivity
-
initRideHoglinActivity
-
createIdleLookBehaviors
-
createIdleMovementBehaviors
-
avoidRepellent
-
babyAvoidNemesis
-
avoidZombified
-
updateActivity
-
isBabyRidingBaby
-
pickUpItem
-
holdInOffhand
-
removeOneItemFromItemEntity
-
stopHoldingOffHandItem
-
cancelAdmiring
-
putInInventory
-
throwItems
-
throwItemsTowardRandomPos
private static void throwItemsTowardRandomPos(PiglinEntity p_234490_0_, List<ItemStack> p_234490_1_) -
throwItemsTowardPlayer
private static void throwItemsTowardPlayer(PiglinEntity p_234472_0_, PlayerEntity p_234472_1_, List<ItemStack> p_234472_2_) -
throwItemsTowardPos
private static void throwItemsTowardPos(PiglinEntity p_234476_0_, List<ItemStack> p_234476_1_, Vector3d p_234476_2_) -
getBarterResponseItems
-
wantsToDance
-
wantsToPickup
-
isLovedItem
-
wantsToStopRiding
-
isNearestValidAttackTarget
private static boolean isNearestValidAttackTarget(PiglinEntity p_234504_0_, LivingEntity p_234504_1_) -
isNearZombified
-
findNearestValidAttackTarget
private static Optional<? extends LivingEntity> findNearestValidAttackTarget(PiglinEntity p_234526_0_) -
angerNearbyPiglins
-
mobInteract
public static ActionResultType mobInteract(PiglinEntity p_234471_0_, PlayerEntity p_234471_1_, Hand p_234471_2_) -
canAdmire
-
wasHurtBy
-
maybeRetaliate
-
getSoundForCurrentActivity
-
getSoundForActivity
-
isNearAvoidTarget
-
hasAnyoneNearbyHuntedRecently
-
getVisibleAdultPiglins
-
getAdultPiglins
-
isWearingGold
-
stopWalking
-
babySometimesRideBabyHoglin
-
broadcastAngerTarget
protected static void broadcastAngerTarget(AbstractPiglinEntity p_234487_0_, LivingEntity p_234487_1_) -
broadcastUniversalAnger
-
broadcastDontKillAnyMoreHoglinsForAWhile
-
setAngerTarget
-
setAngerTargetToNearestTargetablePlayerIfFound
private static void setAngerTargetToNearestTargetablePlayerIfFound(AbstractPiglinEntity p_241431_0_, LivingEntity p_241431_1_) -
setAngerTargetIfCloserThanCurrent
private static void setAngerTargetIfCloserThanCurrent(AbstractPiglinEntity p_234513_0_, LivingEntity p_234513_1_) -
getAngerTarget
-
getAvoidTarget
-
getNearestVisibleTargetablePlayer
public static Optional<PlayerEntity> getNearestVisibleTargetablePlayer(AbstractPiglinEntity p_241432_0_) -
broadcastRetreat
-
retreatFromNearestTarget
-
wantsToStopFleeing
-
piglinsEqualOrOutnumberHoglins
-
hoglinsOutnumberPiglins
-
setAvoidTargetAndDontHuntForAWhile
private static void setAvoidTargetAndDontHuntForAWhile(PiglinEntity p_234521_0_, LivingEntity p_234521_1_) -
dontKillAnyMoreHoglinsForAWhile
-
eat
-
getRandomNearbyPos
-
hasEatenRecently
-
isIdle
-
hasCrossbow
-
admireGoldItem
-
isAdmiringItem
-
isBarterCurrency
-
isFood
-
isAttackAllowed
-
isNearRepellent
-
seesPlayerHoldingLovedItem
-
doesntSeeAnyPlayerHoldingLovedItem
-
isPlayerHoldingLovedItem
-
isAdmiringDisabled
-
wasHurtRecently
-
isHoldingItemInOffHand
-
isNotHoldingLovedItemInOffHand
-
isZombified
-