Defense Abilities
Defense abilities provide bosses with damage mitigation, healing, scaling, and debuff mechanics. Each ability is configured as a behavior entry in the entity JSON with a code and attributes object.
💡 Most abilities use a stages array, allowing different configurations at different health thresholds. The boss activates the first stage whose whenHealthRelBelow condition is met.
Common Properties
These properties are shared by most boss abilities and can be included in any stage configuration:
| Property | Type | Description |
|---|---|---|
whenHealthRelBelow | float | Health fraction threshold (0.0—1.0) to activate this stage |
cooldownSeconds | float | Cooldown between ability uses |
windupMs | int | Windup delay in milliseconds before ability executes |
animation | string | Animation to play during ability |
sound | string | Sound asset path (without sounds/ prefix) |
soundRange | float | Sound audible range (default: 24) |
soundStartMs | int | Delay before sound plays |
soundVolume | float | Sound volume multiplier (default: 1.0) |
loopSound | string | Looping sound during ability |
loopSoundIntervalMs | int | Interval for loop sound (default: 900ms) |
Defense Strategy
Combine multiple defense abilities to create boss phases that punish greedy damage:
graph TD
A[100% HP] --> B[Combat opens]
B --> C[90% HP: Intoxication Aura
constant area pressure]
C --> D[70% HP: Despair
slow players + debuff]
D --> E[50% HP: Cast Phase
heal + reduced damage]
E --> F[40% HP: Growth Ritual
full heal + size/speed up]
F --> G[30% HP: Damage Shield
survive burst]
G --> H[20% HP: Invulnerability
desperation window]
H --> I[10% HP: Damage Shield
repeatable — final stand]bossdamageshield
EntityBehaviorBossDamageShield — Boss activates a shield reducing incoming damage.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
shieldMs | int | 2500 | Shield duration |
windupMs | int | 0 | Windup |
cooldownSeconds | float | 0 | Cooldown |
repeatable | bool | false | Can repeat while conditions met |
immobileDuringShield | bool | false | Boss cannot move during shield |
lockYawDuringShield | bool | false | Lock rotation during shield |
incomingDamageMultiplier | float | 0.5 | Damage multiplier during shield |
{
"code": "bossdamageshield",
"attributes": {
"whenHealthRelBelow": 0.3,
"shieldMs": 5000,
"windupMs": 200,
"cooldownSeconds": 25,
"repeatable": true,
"incomingDamageMultiplier": 0.2
}
}bossdespair
EntityBehaviorBossDespair — Boss applies a despair debuff reducing player effectiveness.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
radius | float | 15 | Effect radius |
durationMs | int | 5000 | Debuff duration |
walkSpeedMult | float | 0.7 | Walk speed multiplier |
{
"code": "bossdespair",
"attributes": {
"whenHealthRelBelow": 0.5,
"cooldownSeconds": 30,
"radius": 20,
"durationMs": 8000,
"walkSpeedMult": 0.5
}
}bossintoxicationaura
EntityBehaviorBossIntoxicationAura — Boss creates an aura that intoxicates players.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
radius | float | 10 | Aura radius |
damagePerSecond | float | 1 | Damage per second |
{
"code": "bossintoxicationaura",
"attributes": {
"whenHealthRelBelow": 1.0,
"radius": 12,
"damagePerSecond": 2
}
}bossoxygendrainaura
EntityBehaviorBossOxygenDrainAura — Boss drains oxygen from nearby players.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
radius | float | 12 | Aura radius |
drainPerSecond | float | 5 | Oxygen drain per second |
{
"code": "bossoxygendrainaura",
"attributes": {
"whenHealthRelBelow": 0.6,
"radius": 15,
"drainPerSecond": 8
}
}bossdamageinvulnerability
EntityBehaviorBossDamageInvulnerability — Boss becomes invulnerable to damage for a duration.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
invulnerabilityMs | int | 2000 | Duration |
cooldownSeconds | float | 0 | Cooldown |
{
"code": "bossdamageinvulnerability",
"attributes": {
"whenHealthRelBelow": 0.2,
"invulnerabilityMs": 4000,
"cooldownSeconds": 30
}
}bossdamagesourceimmunity
EntityBehaviorBossDamageSourceImmunity — Boss is immune to specific damage sources.
| Property | Type | Default | Description |
|---|---|---|---|
immuneDamageTypes | array | [] | List of immune damage types |
immuneDamageSources | array | [] | List of immune damage sources |
{
"code": "bossdamagesourceimmunity",
"attributes": {
"immuneDamageTypes": ["Fire", "Poison"],
"immuneDamageSources": ["Fall"]
}
}bossdynamicsscaling
EntityBehaviorBossDynamicScaling — Boss HP scales with nearby player count. *(DISABLED)*
| Property | Type | Default | Description |
|---|---|---|---|
baseHealthMult | float | 1.6 | Base health multiplier |
hpPerPlayer | float | 0.30 | HP added per player |
maxMultiplier | float | 4.0 | Maximum multiplier |
regenPerPlayer | float | 0.2 | Regen per player per second |
playerDetectionRange | int | 60 | Detection range |
{
"code": "bossdynamicsscaling",
"attributes": {
"baseHealthMult": 2.0,
"hpPerPlayer": 0.5,
"maxMultiplier": 5.0,
"regenPerPlayer": 0.3,
"playerDetectionRange": 80
}
}bosscastphase
EntityBehaviorBossCastPhase — Boss enters a casting phase: heals over time and takes reduced damage.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
castMs | int | 8000 | Cast phase duration |
healPerSecond | float | 0 | Heal per second |
healRelPerSecond | float | 0 | Relative heal per second (fraction) |
incomingDamageMultiplier | float | 0.5 | Incoming damage multiplier |
animation | string | null | Casting animation |
loopSound | string | null | Looping sound during cast |
loopSoundRange | float | 24 | Loop sound range |
loopSoundIntervalMs | int | 900 | Loop sound interval |
windupSound | string | null | Windup sound |
windupSoundRange | float | 24 | Windup sound range |
windupSoundStartMs | int | 0 | Windup sound delay |
{
"code": "bosscastphase",
"attributes": {
"whenHealthRelBelow": 0.3,
"castMs": 10000,
"healPerSecond": 5,
"incomingDamageMultiplier": 0.25,
"animation": "cast",
"loopSound": "game:effect/darkmagic"
}
}bossgrowthritual
EntityBehaviorBossGrowthRitual — Boss grows in size, speed and damage. Heals to full health.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
sizeMultiplier | float | 1.5 | Size multiplier |
speedMultiplier | float | 1.0 | Walk speed multiplier |
damageMultiplier | float | 1.3 | Damage multiplier |
animation | string | null | Growth animation |
lightningFlash | bool | false | Lightning flash effect |
{
"code": "bossgrowthritual",
"attributes": {
"whenHealthRelBelow": 0.4,
"sizeMultiplier": 2.0,
"speedMultiplier": 1.3,
"damageMultiplier": 1.5,
"lightningFlash": true
}
}Complete Entity Example
A boss that uses layered defense abilities for a 3-phase encounter:
{
"code": "yourmod:fortress-guardian",
"server": {
"behaviors": [
{ "code": "health", "maxhealth": 2000 },
{ "code": "bosshuntcombatmarker" },
{ "code": "bossnametag", "attributes": { "displayName": "Fortress Guardian" } },
{
"code": "bossintoxicationaura",
"attributes": {
"whenHealthRelBelow": 1.0,
"radius": 12,
"damagePerSecond": 2
}
},
{
"code": "bossdespair",
"attributes": {
"whenHealthRelBelow": 0.7,
"cooldownSeconds": 30,
"radius": 18,
"durationMs": 6000,
"walkSpeedMult": 0.5
}
},
{
"code": "bosscastphase",
"attributes": {
"whenHealthRelBelow": 0.5,
"castMs": 8000,
"healPerSecond": 8,
"incomingDamageMultiplier": 0.25,
"animation": "cast",
"loopSound": "game:effect/darkmagic"
}
},
{
"code": "bossgrowthritual",
"attributes": {
"whenHealthRelBelow": 0.4,
"sizeMultiplier": 1.8,
"speedMultiplier": 1.2,
"damageMultiplier": 1.4,
"lightningFlash": true
}
},
{
"code": "bossdamageshield",
"attributes": {
"whenHealthRelBelow": 0.3,
"shieldMs": 5000,
"cooldownSeconds": 20,
"repeatable": true,
"incomingDamageMultiplier": 0.2,
"immobileDuringShield": true
}
},
{
"code": "bossdamageinvulnerability",
"attributes": {
"whenHealthRelBelow": 0.2,
"invulnerabilityMs": 3000,
"cooldownSeconds": 45
}
}
]
}
}💡 Pair defense abilities with combat abilities (see Combat Abilities) so the boss isn't just a damage sponge — it should hit back while defending.
bossabsorb
EntityBehaviorBossAbsorb — Boss activates a shield that absorbs N hits without taking damage. After absorbing all hits — AoE explosion. If duration expires first — shield drops harmlessly.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
maxTargetRange | float | 30 | Target range |
absorbHitCount | int | 5 | Hits absorbed before explosion |
absorbDurationSec | float | 6 | Shield duration |
explosionDamage | float | 20 | Explosion damage |
explosionRadius | float | 8 | Explosion radius |
sound | string | effect/reverbhit | Explosion sound |
soundRange | float | 32 | Sound range |
{
"code": "bossabsorb",
"attributes": {
"whenHealthRelBelow": 0.5,
"cooldownSeconds": 25,
"maxTargetRange": 25,
"absorbHitCount": 7,
"absorbDurationSec": 8,
"explosionDamage": 25,
"explosionRadius": 10
}
}bossarena
EntityBehaviorBossArena — Creates a ring boundary around the boss's activation position. Players who cross the boundary take damage + get pushed back. Arena does not move with the boss.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
maxTargetRange | float | 30 | Target range |
arenaRadius | float | 12 | Arena radius |
arenaDurationSec | float | 20 | Arena duration |
boundaryDps | float | 8 | Damage per second outside boundary |
sound | string | effect/translocate-active | Activation sound |
soundRange | float | 32 | Sound range |
{
"code": "bossarena",
"attributes": {
"whenHealthRelBelow": 0.6,
"cooldownSeconds": 30,
"maxTargetRange": 25,
"arenaRadius": 15,
"arenaDurationSec": 25,
"boundaryDps": 10
}
}bossdebuff
EntityBehaviorBossDebuff — Applies a debuff to a target player. Supports blind, disarm, and silence.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
maxTargetRange | float | 30 | Target range |
debuffType | string | blind | Debuff type: blind, disarm, silence |
durationSec | float | 3 | Debuff duration |
sound | string | effect/translocate-active | Sound |
soundRange | float | 24 | Sound range |
💡 - blind — drastically reduces view distance and ranged accuracy - disarm — sets alegacyvsquest:disarmed flag (blocks weapon damage) - silence — sets alegacyvsquest:silenced flag (blocks item use)
{
"code": "bossdebuff",
"attributes": {
"whenHealthRelBelow": 0.5,
"cooldownSeconds": 15,
"maxTargetRange": 20,
"debuffType": "blind",
"durationSec": 5
}
}bossmimicattack
EntityBehaviorBossMimicAttack — Boss enters a mirror state reflecting damage back to attackers. Boss still takes reduced damage during mirror.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
maxTargetRange | float | 30 | Target range |
mirrorDurationSec | float | 3 | Mirror duration |
reflectPercent | float | 0.8 | Damage reflected (0.8 = 80%) |
sound | string | effect/translocate-active | Sound |
soundRange | float | 24 | Sound range |
{
"code": "bossmimicattack",
"attributes": {
"whenHealthRelBelow": 0.5,
"cooldownSeconds": 20,
"maxTargetRange": 25,
"mirrorDurationSec": 4,
"reflectPercent": 0.75
}
}bossretaliation
EntityBehaviorBossRetaliation — Reactive ability. On receiving damage, boss absorbs incoming damage over a window. After reaching a threshold or when the window expires, releases it as an AoE burst.
| Property | Type | Default | Description |
|---|---|---|---|
whenHealthRelBelow | float | 1.0 | Health threshold |
cooldownSeconds | float | 0 | Cooldown |
maxTargetRange | float | 30 | Target range |
damageThreshold | float | 16 | Damage to absorb before retaliating |
retaliationMultiplier | float | 0.6 | Retaliation damage = absorbed * this |
retaliationRadius | float | 6 | Burst radius |
windowDurationSec | float | 4 | Absorption window |
sound | string | effect/reverbhit | Burst sound |
soundRange | float | 32 | Sound range |
{
"code": "bossretaliation",
"attributes": {
"whenHealthRelBelow": 0.5,
"cooldownSeconds": 25,
"maxTargetRange": 25,
"damageThreshold": 20,
"retaliationMultiplier": 0.7,
"retaliationRadius": 8,
"windowDurationSec": 5
}
}bossvulnerabilitywindow
EntityBehaviorBossVulnerabilityWindow — After specified abilities complete, the boss takes increased damage for a configurable duration. Visual: golden aura particles.
| Property | Type | Default | Description |
|---|---|---|---|
damageMultiplier | float | 2.0 | Incoming damage multiplier during window |
durationSeconds | float | 2.5 | Vulnerability duration |
cooldownSeconds | float | 0 | Cooldown between windows |
triggerAbilities | string[] | [] | Ability codes that trigger vulnerability (e.g. bossbloodprice, bosscastphase) |
💡 Other abilities call OnAbilityCompleted() on this behavior to trigger the window. Common pairings: - bossbloodprice — after healing threshold, boss becomes vulnerable - bosscastphase — after casting completes, boss becomes vulnerable - bossintermissiondispel — after intermission ends, boss becomes vulnerable
{
"code": "bossvulnerabilitywindow",
"attributes": {
"damageMultiplier": 2.5,
"durationSeconds": 3.0,
"cooldownSeconds": 5,
"triggerAbilities": ["bossbloodprice", "bosscastphase"]
}
}