Class SpearApproach
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<PathfinderMob>
net.minecraft.world.entity.ai.behavior.SpearApproach
- All Implemented Interfaces:
BehaviorControl<PathfinderMob>
-
Nested Class Summary
Nested classes/interfaces inherited from class Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final floatprivate final doubleFields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionSpearApproach(double speedModifierWhenRepositioning, float approachDistance) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprotected booleancanStillUse(ServerLevel level, PathfinderMob body, long timestamp) protected booleancheckExtraStartConditions(ServerLevel level, PathfinderMob body) private booleanfarEnough(PathfinderMob mob) private @Nullable LivingEntitygetTarget(PathfinderMob mob) protected voidstart(ServerLevel level, PathfinderMob body, long timestamp) protected voidstop(ServerLevel level, PathfinderMob body, long timestamp) protected voidtick(ServerLevel level, PathfinderMob mob, long timestamp) protected booleantimedOut(long timestamp) Methods inherited from class Behavior
debugString, doStop, getRequiredMemories, getStatus, hasRequiredMemories, tickOrStop, tryStart
-
Field Details
-
speedModifierWhenRepositioning
private final double speedModifierWhenRepositioning -
approachDistanceSq
private final float approachDistanceSq
-
-
Constructor Details
-
SpearApproach
public SpearApproach(double speedModifierWhenRepositioning, float approachDistance)
-
-
Method Details
-
ableToAttack
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<PathfinderMob>
-
start
- Overrides:
startin classBehavior<PathfinderMob>
-
getTarget
-
canStillUse
- Overrides:
canStillUsein classBehavior<PathfinderMob>
-
farEnough
-
tick
- Overrides:
tickin classBehavior<PathfinderMob>
-
stop
- Overrides:
stopin classBehavior<PathfinderMob>
-
timedOut
protected boolean timedOut(long timestamp) - Overrides:
timedOutin classBehavior<PathfinderMob>
-