CombatConfig
Full combat behavior configuration for hostile citizens — attack style, movement in combat, blocking, timing, and more.
package com.electro.hycitizens.models;
copyFrom
void copyFrom(@Nonnull CombatConfig other)
Copies all fields from another CombatConfig.
Attack & Chase
getAttackType / setAttackType
String getAttackType() / void setAttackType(String attackType)
The attack ability name. Default: "Root_NPC_Attack_Melee".
getAttackDistance / setAttackDistance
float getAttackDistance() / void setAttackDistance(float distance)
Range at which the citizen can attack (blocks). Default: 2.0.
getChaseSpeed / setChaseSpeed
float getChaseSpeed() / void setChaseSpeed(float speed)
Speed multiplier when chasing a target (0–1). Default: 0.67.
getCombatBehaviorDistance / setCombatBehaviorDistance
float getCombatBehaviorDistance() / void setCombatBehaviorDistance(float distance)
Distance at which combat behavior activates. Default: 5.0.
getDesiredAttackDistanceMin / Max
float getDesiredAttackDistanceMin() / void setDesiredAttackDistanceMin(float v)
float getDesiredAttackDistanceMax() / void setDesiredAttackDistanceMax(float v)
Preferred attack distance range (blocks). Default: 1.5 – 1.5.
getTargetRange / setTargetRange
float getTargetRange() / void setTargetRange(float range)
Range within which the citizen acquires new targets. Default: 4.0.
Attack Timing
getAttackPauseMin / Max
float getAttackPauseMin() / void setAttackPauseMin(float v)
float getAttackPauseMax() / void setAttackPauseMax(float v)
Wait time between attacks. Default: 1.5 – 2.0 seconds.
getCombatAttackPreDelayMin / Max
float getCombatAttackPreDelayMin() / void setCombatAttackPreDelayMin(float v)
float getCombatAttackPreDelayMax() / void setCombatAttackPreDelayMax(float v)
Delay before initiating an attack (wind-up). Default: 0.2 – 0.2 seconds.
getCombatAttackPostDelayMin / Max
float getCombatAttackPostDelayMin() / void setCombatAttackPostDelayMin(float v)
float getCombatAttackPostDelayMax() / void setCombatAttackPostDelayMax(float v)
Delay after an attack completes (recovery). Default: 0.2 – 0.2 seconds.
Movement in Combat
getCombatStrafeWeight / setCombatStrafeWeight
int getCombatStrafeWeight() / void setCombatStrafeWeight(int weight)
Weight for strafing movement. Higher = more strafing. Default: 10.
getCombatDirectWeight / setCombatDirectWeight
int getCombatDirectWeight() / void setCombatDirectWeight(int weight)
Weight for direct approach. Default: 10.
getCombatAlwaysMovingWeight / setCombatAlwaysMovingWeight
int getCombatAlwaysMovingWeight() / void setCombatAlwaysMovingWeight(int weight)
Weight for always-moving behavior in combat. Default: 0.
getCombatStrafingDurationMin / Max
float getCombatStrafingDurationMin() / void setCombatStrafingDurationMin(float v)
float getCombatStrafingDurationMax() / void setCombatStrafingDurationMax(float v)
How long a strafe movement lasts. Default: 1.0 – 1.0 seconds.
getCombatStrafingFrequencyMin / Max
float getCombatStrafingFrequencyMin() / void setCombatStrafingFrequencyMin(float v)
float getCombatStrafingFrequencyMax() / void setCombatStrafingFrequencyMax(float v)
How often strafe movements occur. Default: 2.0 – 2.0 seconds.
getCombatRelativeTurnSpeed / setCombatRelativeTurnSpeed
float getCombatRelativeTurnSpeed() / void setCombatRelativeTurnSpeed(float v)
How fast the citizen turns toward their target in combat. Default: 1.5.
getCombatMovingRelativeSpeed / setCombatMovingRelativeSpeed
float getCombatMovingRelativeSpeed() / void setCombatMovingRelativeSpeed(float v)
Forward speed in combat relative to base speed (0–1). Default: 0.6.
getCombatBackwardsRelativeSpeed / setCombatBackwardsRelativeSpeed
float getCombatBackwardsRelativeSpeed() / void setCombatBackwardsRelativeSpeed(float v)
Backward speed in combat relative to base speed (0–1). Default: 0.3.
getCombatFleeIfTooCloseDistance / setCombatFleeIfTooCloseDistance
float getCombatFleeIfTooCloseDistance() / void setCombatFleeIfTooCloseDistance(float v)
The citizen will flee if a target gets closer than this distance. 0 = disabled. Default: 0.
Back-Off Behavior
isBackOffAfterAttack / setBackOffAfterAttack
boolean isBackOffAfterAttack() / void setBackOffAfterAttack(boolean v)
Whether to step back after attacking. Default: true.
getBackOffDistance / setBackOffDistance
float getBackOffDistance() / void setBackOffDistance(float distance)
Distance to step back after attacking. Default: 4.0.
getBackOffDurationMin / Max
float getBackOffDurationMin() / void setBackOffDurationMin(float v)
float getBackOffDurationMax() / void setBackOffDurationMax(float v)
How long the back-off movement lasts. Default: 2.0 – 3.0 seconds.
Blocking
getBlockAbility / setBlockAbility
String getBlockAbility() / void setBlockAbility(String ability)
The block ability name. Default: "Shield_Block".
getBlockProbability / setBlockProbability
int getBlockProbability() / void setBlockProbability(int probability)
Chance (0–100) that the citizen attempts to block an incoming attack. Default: 50.
Target Switching
getTargetSwitchTimerMin / Max
float getTargetSwitchTimerMin() / void setTargetSwitchTimerMin(float v)
float getTargetSwitchTimerMax() / void setTargetSwitchTimerMax(float v)
How long until the citizen may switch targets. Default: 5.0 – 5.0 seconds.
Combat Action Evaluator
isUseCombatActionEvaluator / setUseCombatActionEvaluator
boolean isUseCombatActionEvaluator() / void setUseCombatActionEvaluator(boolean v)
Enable advanced combat action evaluation. Default: false.