Class RaiderMeleeAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>
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.RaiderMeleeAI<T>
- All Implemented Interfaces:
IStateAI
public class RaiderMeleeAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>
extends AttackMoveAI<T>
Raider AI for melee attacking a target
-
Field Summary
Fields inherited from class com.minecolonies.core.entity.ai.combat.AttackMoveAI
nextAttackTime -
Constructor Summary
Constructors -
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 intThe search range in blocks, used for determining a shaped aabb entity lookupprotected booleanisAttackableTarget(net.minecraft.world.entity.LivingEntity target) 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 positionMethods 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, getYSearchRange, isEntityValidTarget, onTargetChange, onTargetDied, searchNearbyTarget, skipSearch
-
Constructor Details
-
RaiderMeleeAI
-
-
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<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>- Parameters:
target-
-
getAttackDistance
protected double getAttackDistance()Description copied from class:AttackMoveAIGet the attack distance- Overrides:
getAttackDistancein classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>- 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>- Returns:
- default 40 ticks
-
moveInAttackPosition
Description copied from class:AttackMoveAIMovement to get into attack position- Overrides:
moveInAttackPositionin classAttackMoveAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>- 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>- Parameters:
target-- 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>- Parameters:
target-- Returns:
-
getSearchRange
protected int getSearchRange()Description copied from class:TargetAIThe search range in blocks, used for determining a shaped aabb entity lookup- Overrides:
getSearchRangein classTargetAI<T extends AbstractEntityMinecoloniesMonster & IThreatTableEntity>- Returns:
-