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 intprivate static final intprivate static final intprivate static final intprivate final Function<PathfinderMob, TagKey<DamageType>> private final floatFields inherited from class net.minecraft.world.entity.ai.behavior.Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionAnimalPanic(float speedMultiplier) AnimalPanic(float speedMultiplier, Function<PathfinderMob, TagKey<DamageType>> panicCausingDamageTypes) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanStillUse(ServerLevel level, E entity, long gameTime) protected booleancheckExtraStartConditions(ServerLevel level, E owner) private Vec3getPanicPos(E pathfinder, ServerLevel level) lookForWater(BlockGetter level, Entity entity) protected voidstart(ServerLevel level, E entity, long gameTime) protected voidstop(ServerLevel level, E entity, long gameTime) protected voidtick(ServerLevel level, E owner, long gameTime) 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 speedMultiplier) -
AnimalPanic
public AnimalPanic(float speedMultiplier, Function<PathfinderMob, TagKey<DamageType>> panicCausingDamageTypes)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<E extends PathfinderMob>
-
canStillUse
- Overrides:
canStillUsein classBehavior<E extends PathfinderMob>
-
start
- Overrides:
startin classBehavior<E extends PathfinderMob>
-
stop
- Overrides:
stopin classBehavior<E extends PathfinderMob>
-
tick
- Overrides:
tickin classBehavior<E extends PathfinderMob>
-
getPanicPos
-
lookForWater
-