Class SpearAttack
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<PathfinderMob>
net.minecraft.world.entity.ai.behavior.SpearAttack
- All Implemented Interfaces:
BehaviorControl<PathfinderMob>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intprivate final doubleprivate final doubleprivate final floatFields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionSpearAttack(double speedModifierWhenCharging, double speedModifierWhenRepositioning, float targetInRangeRadius) -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanprotected booleancanStillUse(ServerLevel level, PathfinderMob body, long timestamp) protected booleancheckExtraStartConditions(ServerLevel level, PathfinderMob body) private intprivate @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
-
MIN_REPOSITION_DISTANCE
public static final int MIN_REPOSITION_DISTANCE- See Also:
-
MAX_REPOSITION_DISTANCE
public static final int MAX_REPOSITION_DISTANCE- See Also:
-
speedModifierWhenCharging
private final double speedModifierWhenCharging -
speedModifierWhenRepositioning
private final double speedModifierWhenRepositioning -
targetInRangeRadiusSq
private final float targetInRangeRadiusSq
-
-
Constructor Details
-
SpearAttack
public SpearAttack(double speedModifierWhenCharging, double speedModifierWhenRepositioning, float targetInRangeRadius)
-
-
Method Details
-
getTarget
-
ableToAttack
-
getKineticWeaponUseDuration
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<PathfinderMob>
-
start
- Overrides:
startin classBehavior<PathfinderMob>
-
canStillUse
- Overrides:
canStillUsein classBehavior<PathfinderMob>
-
tick
- Overrides:
tickin classBehavior<PathfinderMob>
-
stop
- Overrides:
stopin classBehavior<PathfinderMob>
-
timedOut
protected boolean timedOut(long timestamp) - Overrides:
timedOutin classBehavior<PathfinderMob>
-