Package org.mcmonkey.sentinel
Class SentinelAttackHelper
java.lang.Object
org.mcmonkey.sentinel.SentinelHelperObject
org.mcmonkey.sentinel.SentinelAttackHelper
Helper for Sentinel NPCs attacking targets.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic doubleFlocker influence constants, for "generateNewFlocker".static doubleFlocker influence constants, for "generateNewFlocker".static doubleFlocker influence constants, for "generateNewFlocker".Fields inherited from class org.mcmonkey.sentinel.SentinelHelperObject
attackHelper, itemHelper, sentinel, targetingHelper, weaponHelper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchase(org.bukkit.entity.LivingEntity entity) Causes the NPC to chase a target.static net.citizensnpcs.api.ai.flocking.FlockergenerateNewFlocker(net.citizensnpcs.api.npc.NPC npc, double radius) Generates a Citizens flocker instance to help keep NPCs from clumping.voidPost-calculation for ammo handling.booleanrangedPreCalculation(org.bukkit.entity.LivingEntity entity) Pre-calculation for ranged attacks.voidrechase()Repeats the last chase instruction (to ensure the NPC keeps going for a target).booleanseesThreatFrom(org.bukkit.entity.LivingEntity entity) Returns a boolean indicating whether the NPC sees a threat from the input entity (for use with shield blocking).booleantryAttack(org.bukkit.entity.LivingEntity target) Causes the NPC to attempt an attack on a target.booleantryAttackInternal(org.bukkit.entity.LivingEntity entity) Internal attack attempt logic.voidtryDefendFrom(org.bukkit.entity.LivingEntity entity) Causes the entity to prepare to defend against a dangerous opponent (if it sees the threat).Methods inherited from class org.mcmonkey.sentinel.SentinelHelperObject
debug, getLivingEntity, getNPC, setTraitObject
-
Field Details
-
HIGH_INFLUENCE
public static double HIGH_INFLUENCEFlocker influence constants, for "generateNewFlocker". -
LOW_INFLUENCE
public static double LOW_INFLUENCEFlocker influence constants, for "generateNewFlocker". -
FLOCK_RADIUS
public static double FLOCK_RADIUSFlocker influence constants, for "generateNewFlocker".
-
-
Constructor Details
-
SentinelAttackHelper
public SentinelAttackHelper()
-
-
Method Details
-
chase
public void chase(org.bukkit.entity.LivingEntity entity) Causes the NPC to chase a target. -
generateNewFlocker
public static net.citizensnpcs.api.ai.flocking.Flocker generateNewFlocker(net.citizensnpcs.api.npc.NPC npc, double radius) Generates a Citizens flocker instance to help keep NPCs from clumping. -
rechase
public void rechase()Repeats the last chase instruction (to ensure the NPC keeps going for a target). -
seesThreatFrom
public boolean seesThreatFrom(org.bukkit.entity.LivingEntity entity) Returns a boolean indicating whether the NPC sees a threat from the input entity (for use with shield blocking). -
tryDefendFrom
public void tryDefendFrom(org.bukkit.entity.LivingEntity entity) Causes the entity to prepare to defend against a dangerous opponent (if it sees the threat). This will raise the NPC's shield (if it has one). -
tryAttack
public boolean tryAttack(org.bukkit.entity.LivingEntity target) Causes the NPC to attempt an attack on a target. Returns whether any attack occurred. -
rangedPreCalculation
public boolean rangedPreCalculation(org.bukkit.entity.LivingEntity entity) Pre-calculation for ranged attacks. Returns 'true' when the attack should be cancelled. -
rangedAmmoCalculation
public void rangedAmmoCalculation()Post-calculation for ammo handling. -
tryAttackInternal
public boolean tryAttackInternal(org.bukkit.entity.LivingEntity entity) Internal attack attempt logic.
-