Class RaiderRangedAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>
java.lang.Object
com.minecolonies.core.entity.ai.combat.TargetAI<T>
com.minecolonies.core.entity.ai.combat.AttackMoveAI<T>
com.minecolonies.core.entity.mobs.aitasks.RaiderRangedAI<T>
- All Implemented Interfaces:
IStateAI
public class RaiderRangedAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>
extends AttackMoveAI<T>
Raider AI for shooting arrows at a target
-
Field Summary
Fields inherited from class com.minecolonies.core.entity.ai.combat.AttackMoveAI
nextAttackTime -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether we can attackprotected booleanChecks if the current targets is still valid, if not searches a new target.protected 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 booleanisAttackableTarget(net.minecraft.world.entity.LivingEntity target) Whether the target is attackableprotected booleanisInDistanceForAttack(net.minecraft.world.entity.LivingEntity target) Check if the target is in distance for beeing attackedprotected 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 positionMethods inherited from class com.minecolonies.core.entity.ai.combat.AttackMoveAI
isInAttackDistance, resetTarget, tryAttackMethods inherited from class com.minecolonies.core.entity.ai.combat.TargetAI
getSearchArea, getSearchRange, getYSearchRange, isEntityValidTarget, onTargetChange, onTargetDied, searchNearbyTarget, skipSearch
-
Constructor Details
-
RaiderRangedAI
-
-
Method Details
-
isInDistanceForAttack
protected boolean isInDistanceForAttack(net.minecraft.world.entity.LivingEntity target) Description copied from class:AttackMoveAICheck if the target is in distance for beeing attacked- Overrides:
isInDistanceForAttackin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Parameters:
target- target to check- Returns:
- true if we do attack
-
doAttack
protected void doAttack(net.minecraft.world.entity.LivingEntity target) Description copied from class:AttackMoveAIThe actual attack triggered on the target- Overrides:
doAttackin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>
-
getAttackDistance
protected double getAttackDistance()Description copied from class:AttackMoveAIGet the attack distance- Overrides:
getAttackDistancein classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
- distance in blocks
-
getAttackDelay
protected int getAttackDelay()Description copied from class:AttackMoveAIGet the delay to next attack in ticks- Overrides:
getAttackDelayin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
- default 40 ticks
-
canAttack
public boolean canAttack()Description copied from class:AttackMoveAIWhether we can attack- Overrides:
canAttackin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
-
checkForTarget
protected boolean checkForTarget()Description copied from class:TargetAIChecks if the current targets is still valid, if not searches a new target. Adds experience if the current target died.- Overrides:
checkForTargetin classTargetAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
- true if we found a target, false if no target.
-
moveInAttackPosition
Description copied from class:AttackMoveAIMovement to get into attack position- Overrides:
moveInAttackPositionin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Parameters:
target- target to move towards- Returns:
- path result
-
isAttackableTarget
protected boolean isAttackableTarget(net.minecraft.world.entity.LivingEntity target) Description copied from class:TargetAIWhether the target is attackable- Overrides:
isAttackableTargetin classTargetAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
-
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<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity & IRangedMobEntity>- Returns:
-