Interface CreatureBehavior
- All Superinterfaces:
EntityBehavior
- All Known Subinterfaces:
AllayBehavior, AxolotlBehavior, BreezeBehavior, CamelBehavior, FrogBehavior, PiglinBehavior, VillagerBehavior, WardenBehavior
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull BehaviorResultFollows the Entity's Temptation (e.g.default @NotNull BehaviorResultfollowTemptation(float speedMod) Follows the Entity's Temptation (e.g.@NotNull BehaviorResultfollowTemptation(@NotNull Function<LivingEntity, Float> speedModifier) Follows the Entity's Temptation (e.g.default @NotNull BehaviorResultpanic()Makes this Creature panic with the default speed modifier.@NotNull BehaviorResultpanic(float speedMod) Makes this Creature panic.default @NotNull BehaviorResulttryFindWater(int range) Makes this Creature attempt to find water, with no speed modifier.@NotNull BehaviorResulttryFindWater(int range, float speedMod) Makes this Creature attempt to find water.Methods inherited from interface EntityBehavior
backupIfClose, backupIfClose, eraseIf, interactWithDoor, jumpOnBed, jumpOnBed, meleeAttack, meleeAttack, moveToWantedItem, moveToWantedItem, moveToWantedItem, passiveIf, reactToBell, ringBell, sleep, socializeAtBell, wakeUp
-
Method Details
-
panic
Makes this Creature panic.This behavior only natively exists on 1.17+, meaning that on 1.17 and above,
EntityMemory.IS_PANICKINGneeds to be registered, while on all versions,EntityMemory.LAST_HURT_ENTITYneeds to be present.- Parameters:
speedMod- Speed Modifier while panicking- Returns:
- Result of Behavior
-
panic
Makes this Creature panic with the default speed modifier.This behavior only natively exists on 1.17+, meaning that on 1.17 and above,
EntityMemory.IS_PANICKINGneeds to be registered, while on all versions,EntityMemory.LAST_HURT_ENTITYneeds to be present.- Returns:
- Result of Behavior
-
followTemptation
@NotNull @NotNull BehaviorResult followTemptation(@NotNull @NotNull Function<LivingEntity, Float> speedModifier) throws IllegalArgumentException Follows the Entity's Temptation (e.g. target, tempting player).This behavior requires the following memories to be registered:
This behavior also requires
EntityMemory.TEMPTING_PLAYERmemories to be present in the brain.Finally, this behavior requires the following memories to be absent from the brain:
- Parameters:
speedModifier- Function that returns speed modifier- Returns:
- Result of Behavior
- Throws:
IllegalArgumentException- if speed modifier is null
-
followTemptation
Follows the Entity's Temptation (e.g. target, tempting player).This behavior requires the following memories to be registered:
This behavior also requires
EntityMemory.TEMPTING_PLAYERmemories to be present in the brain.Finally, this behavior requires the following memories to be absent from the brain:
- Parameters:
speedMod- Speed Modifier while following- Returns:
- Result of Behavior
-
followTemptation
Follows the Entity's Temptation (e.g. target, tempting player), with no Speed Modifier.This behavior requires the following memories to be registered:
This behavior also requires
EntityMemory.TEMPTING_PLAYERmemories to be present in the brain.Finally, this behavior requires the following memories to be absent from the brain:
- Returns:
- Result of Behavior
-
tryFindWater
Makes this Creature attempt to find water.This behavior does not require any memories.
- Parameters:
range- Radius of how far to lookspeedMod- Speed Modifier while looking- Returns:
- Result of Behavior
-
tryFindWater
Makes this Creature attempt to find water, with no speed modifier.This behavior does not require any memories.
- Parameters:
range- Radius of how far to look- Returns:
- Result of Behavior
-