Class DruidCombatAI
java.lang.Object
com.minecolonies.core.entity.ai.combat.TargetAI<EntityCitizen>
com.minecolonies.core.entity.ai.combat.AttackMoveAI<EntityCitizen>
com.minecolonies.core.entity.ai.workers.guard.DruidCombatAI
- All Implemented Interfaces:
IStateAI
Druid combat AI
-
Field Summary
FieldsFields inherited from class com.minecolonies.core.entity.ai.combat.AttackMoveAI
nextAttackTime -
Constructor Summary
ConstructorsConstructorDescriptionDruidCombatAI(EntityCitizen owner, ITickRateStateMachine stateMachine, AbstractEntityAIGuard parentAI) -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoAttack(net.minecraft.world.entity.LivingEntity target) The actual attack triggered on the targetprotected intGet the delay to next attack in ticksprotected doubleGet the attack distanceprotected doubleGet combat speedprotected intGet the Y search rangeprotected booleanisAttackableTarget(net.minecraft.world.entity.LivingEntity entity) Whether the target is attackableprotected booleanisWithinPersecutionDistance(net.minecraft.world.entity.LivingEntity target) Check if the target is within chasing distanceprotected PathResultmoveInAttackPosition(net.minecraft.world.entity.LivingEntity target) Movement to get into attack positionprotected voidonTargetDied(net.minecraft.world.entity.LivingEntity entity) When our previous target has diedprotected booleanGet a target for the guard.protected booleanskipSearch(net.minecraft.world.entity.LivingEntity entity) Skips the search if trueMethods inherited from class com.minecolonies.core.entity.ai.combat.AttackMoveAI
canAttack, isInAttackDistance, isInDistanceForAttack, resetTarget, tryAttackMethods inherited from class com.minecolonies.core.entity.ai.combat.TargetAI
checkForTarget, getSearchArea, getSearchRange, isEntityValidTarget, onTargetChange
-
Field Details
-
POTION_VELOCITY
public static final float POTION_VELOCITYPotion velocity.- See Also:
-
-
Constructor Details
-
DruidCombatAI
public DruidCombatAI(EntityCitizen owner, ITickRateStateMachine stateMachine, AbstractEntityAIGuard parentAI)
-
-
Method Details
-
doAttack
protected void doAttack(net.minecraft.world.entity.LivingEntity target) Description copied from class:AttackMoveAIThe actual attack triggered on the target- Overrides:
doAttackin classAttackMoveAI<EntityCitizen>- Parameters:
target-
-
getAttackDelay
protected int getAttackDelay()Description copied from class:AttackMoveAIGet the delay to next attack in ticks- Overrides:
getAttackDelayin classAttackMoveAI<EntityCitizen>- Returns:
- default 40 ticks
-
getAttackDistance
protected double getAttackDistance()Description copied from class:AttackMoveAIGet the attack distance- Overrides:
getAttackDistancein classAttackMoveAI<EntityCitizen>- Returns:
- distance in blocks
-
moveInAttackPosition
Description copied from class:AttackMoveAIMovement to get into attack position- Overrides:
moveInAttackPositionin classAttackMoveAI<EntityCitizen>- Parameters:
target- target to move towards- Returns:
- path result
-
getCombatMovementSpeed
protected double getCombatMovementSpeed()Get combat speed- Returns:
- movent speed
-
isAttackableTarget
protected boolean isAttackableTarget(net.minecraft.world.entity.LivingEntity entity) Description copied from class:TargetAIWhether the target is attackable- Overrides:
isAttackableTargetin classTargetAI<EntityCitizen>- Parameters:
entity-- Returns:
-
searchNearbyTarget
protected boolean searchNearbyTarget()Description copied from class:TargetAIGet a target for the guard. First check if we're under attack by anything and switch target if necessary.- Overrides:
searchNearbyTargetin classTargetAI<EntityCitizen>- Returns:
- The next IAIState to go to.
-
isWithinPersecutionDistance
protected boolean isWithinPersecutionDistance(net.minecraft.world.entity.LivingEntity target) Description copied from class:TargetAICheck if the target is within chasing distance- Overrides:
isWithinPersecutionDistancein classTargetAI<EntityCitizen>- Parameters:
target-- Returns:
-
skipSearch
protected boolean skipSearch(net.minecraft.world.entity.LivingEntity entity) Description copied from class:TargetAISkips the search if true- Overrides:
skipSearchin classTargetAI<EntityCitizen>- Parameters:
entity- checked entity- Returns:
- true if skip
-
getYSearchRange
protected int getYSearchRange()Description copied from class:TargetAIGet the Y search range- Overrides:
getYSearchRangein classTargetAI<EntityCitizen>- Returns:
-
onTargetDied
protected void onTargetDied(net.minecraft.world.entity.LivingEntity entity) Description copied from class:TargetAIWhen our previous target has died- Overrides:
onTargetDiedin classTargetAI<EntityCitizen>- Parameters:
entity-
-