Class ChargeAttack
java.lang.Object
net.minecraft.world.entity.ai.behavior.Behavior<Animal>
net.minecraft.world.entity.ai.behavior.ChargeAttack
- All Implemented Interfaces:
BehaviorControl<Animal>
-
Nested Class Summary
Nested classes/interfaces inherited from class Behavior
Behavior.Status -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SoundEventprivate final TargetingConditionsprivate Vec3private final floatprivate final doubleprivate final doubleprivate final floatprivate Vec3private final intFields inherited from class Behavior
DEFAULT_DURATION, entryCondition -
Constructor Summary
ConstructorsConstructorDescriptionChargeAttack(int timeBetweenAttacks, TargetingConditions chargeTargeting, float speed, float knockbackForce, double maxChargeDistance, double maxTargetDetectionDistance, SoundEvent chargeSound) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancanStillUse(ServerLevel level, Animal body, long timestamp) protected booleancheckExtraStartConditions(ServerLevel level, Animal body) private voiddealDamageToTarget(ServerLevel level, Animal body, LivingEntity target) private voiddealKnockBack(Animal body, LivingEntity target) protected voidstart(ServerLevel level, Animal body, long timestamp) protected voidstop(ServerLevel level, Animal body, long timestamp) protected voidtick(ServerLevel level, Animal body, long timestamp) Methods inherited from class Behavior
debugString, doStop, getRequiredMemories, getStatus, hasRequiredMemories, tickOrStop, timedOut, tryStart
-
Field Details
-
timeBetweenAttacks
private final int timeBetweenAttacks -
chargeTargeting
-
speed
private final float speed -
knockbackForce
private final float knockbackForce -
maxTargetDetectionDistance
private final double maxTargetDetectionDistance -
maxChargeDistance
private final double maxChargeDistance -
chargeSound
-
chargeVelocityVector
-
startPosition
-
-
Constructor Details
-
ChargeAttack
public ChargeAttack(int timeBetweenAttacks, TargetingConditions chargeTargeting, float speed, float knockbackForce, double maxChargeDistance, double maxTargetDetectionDistance, SoundEvent chargeSound)
-
-
Method Details
-
checkExtraStartConditions
- Overrides:
checkExtraStartConditionsin classBehavior<Animal>
-
canStillUse
- Overrides:
canStillUsein classBehavior<Animal>
-
start
-
tick
-
dealDamageToTarget
-
dealKnockBack
-
stop
-