Class AnimalPanic<E extends PathfinderMob>
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<E>
net.minecraft.world.entity.ai.behavior.AnimalPanic<E>
- All Implemented Interfaces:
BehaviorControl<E>
- Direct Known Subclasses:
ArmadilloAi.ArmadilloPanic
,CamelAi.CamelPanic
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.entity.ai.behavior.Behavior
Behavior.Status
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final int
private static final int
private final Function
<PathfinderMob, TagKey<DamageType>> private final float
Fields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition
-
Constructor Summary
ConstructorsConstructorDescriptionAnimalPanic
(float pSpeedMultiplier) AnimalPanic
(float pSpeedMultiplier, Function<PathfinderMob, TagKey<DamageType>> pPanicCausingDamageTypes) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
canStillUse
(ServerLevel pLevel, E pEntity, long pGameTime) protected boolean
checkExtraStartConditions
(ServerLevel pLevel, E pOwner) private Vec3
getPanicPos
(E pPathfinder, ServerLevel pLevel) lookForWater
(BlockGetter pLevel, Entity pEntity) protected void
start
(ServerLevel pLevel, E pEntity, long pGameTime) protected void
stop
(ServerLevel pLevel, E pEntity, long pGameTime) protected void
tick
(ServerLevel pLevel, E pOwner, long pGameTime) Methods inherited from class net.minecraft.world.entity.ai.behavior.Behavior
debugString, doStop, getStatus, hasRequiredMemories, tickOrStop, timedOut, tryStart
-
Field Details
-
PANIC_MIN_DURATION
private static final int PANIC_MIN_DURATION- See Also:
-
PANIC_MAX_DURATION
private static final int PANIC_MAX_DURATION- See Also:
-
PANIC_DISTANCE_HORIZONTAL
private static final int PANIC_DISTANCE_HORIZONTAL- See Also:
-
PANIC_DISTANCE_VERTICAL
private static final int PANIC_DISTANCE_VERTICAL- See Also:
-
speedMultiplier
private final float speedMultiplier -
panicCausingDamageTypes
-
-
Constructor Details
-
AnimalPanic
public AnimalPanic(float pSpeedMultiplier) -
AnimalPanic
public AnimalPanic(float pSpeedMultiplier, Function<PathfinderMob, TagKey<DamageType>> pPanicCausingDamageTypes)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditions
in classBehavior<E extends PathfinderMob>
-
canStillUse
- Overrides:
canStillUse
in classBehavior<E extends PathfinderMob>
-
start
- Overrides:
start
in classBehavior<E extends PathfinderMob>
-
stop
- Overrides:
stop
in classBehavior<E extends PathfinderMob>
-
tick
- Overrides:
tick
in classBehavior<E extends PathfinderMob>
-
getPanicPos
-
lookForWater
-