Interface PiglinBehavior
- All Superinterfaces:
CreatureBehavior, EntityBehavior
Represents Behavior for a Bukkit Piglin
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidResets the hunting radius used instartHunting()to its default value (100).voidsetHuntingRadius(int radius) Sets the hunting radius used to look for a new Hoglin instartHunting().@NotNull BehaviorResultstartAdmiring(@Nullable Item want, int duration) Makes this Piglin start admiring if a wanted item is near.@NotNull BehaviorResultMakes this Piglin start hunting if a Hoglin is near.@NotNull BehaviorResultMakes this Piglin stop admiring an item if it is admiring an item.@NotNull BehaviorResultMakes this Piglin stop hunting for Piglins.Methods inherited from interface CreatureBehavior
followTemptation, followTemptation, followTemptation, panic, panic, tryFindWater, tryFindWaterMethods inherited from interface EntityBehavior
backupIfClose, backupIfClose, eraseIf, interactWithDoor, jumpOnBed, jumpOnBed, meleeAttack, meleeAttack, moveToWantedItem, moveToWantedItem, moveToWantedItem, passiveIf, reactToBell, ringBell, sleep, socializeAtBell, wakeUp
-
Method Details
-
stopHunting
Makes this Piglin stop hunting for Piglins.This behavior requires
EntityMemory.HAS_HUNTED_RECENTLYto be registered, andEntityMemory.ATTACK_TARGETto be present.- Returns:
- Result of Behavior
-
startAdmiring
Makes this Piglin start admiring if a wanted item is near.This method will set
EntityMemory.IS_ADMIRING_ITEMandEntityMemory.NEAREST_WANTED_ITEMfor you with the provided arguments.This behavior requires
EntityMemory.ADMIRING_DISABLEDandEntityMemory.IS_ADMIRING_ITEMto be absent previously.- Parameters:
want- Item Entity to admireduration- How long to admire the item- Returns:
- Result of Behavior
-
startHunting
Makes this Piglin start hunting if a Hoglin is near.- Returns:
- Result of Behavior
-
setHuntingRadius
Sets the hunting radius used to look for a new Hoglin instartHunting().- Parameters:
radius- Radius to look for a Hoglin- Throws:
IllegalArgumentException- if radius is not positive
-
resetHuntingRadius
default void resetHuntingRadius()Resets the hunting radius used instartHunting()to its default value (100). -
stopAdmiring
Makes this Piglin stop admiring an item if it is admiring an item.This method removes
EntityMemory.IS_ADMIRING_ITEMfor you.- Returns:
- Result of Behavior
-