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