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
Modifier and TypeFieldDescriptionstatic double
Flocker influence constants, for "generateNewFlocker".static double
Flocker influence constants, for "generateNewFlocker".static double
Flocker influence constants, for "generateNewFlocker".Fields inherited from class org.mcmonkey.sentinel.SentinelHelperObject
attackHelper, itemHelper, sentinel, targetingHelper, weaponHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
chase
(org.bukkit.entity.LivingEntity entity) Causes the NPC to chase a target.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.void
Post-calculation for ammo handling.boolean
rangedPreCalculation
(org.bukkit.entity.LivingEntity entity) Pre-calculation for ranged attacks.void
rechase()
Repeats the last chase instruction (to ensure the NPC keeps going for a target).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).boolean
tryAttack
(org.bukkit.entity.LivingEntity target) Causes the NPC to attempt an attack on a target.boolean
tryAttackInternal
(org.bukkit.entity.LivingEntity entity) Internal attack attempt logic.void
tryDefendFrom
(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.
-