Overview
The damage core handles:- Percentage scaling - Display damage as percentage of base damage
- Unique damage IDs - Prevent multi-hitting with iframe system
- Hit tracking - Track which entities have been hit
- Damage indicators - Floating text showing damage dealt
- Modifier integration - Trigger PRE_DAMAGE and DAMAGE modifiers
- Critical effects - Visual and audio feedback for crits
Damage Variants
Three main damage skills with different tagging:| Skill | Tag | Triggers | Use Case |
|---|---|---|---|
damage | None | DAMAGE | Generic damage |
damage-weapon | WEAPON | WEAPON_HIT, DAMAGE | Melee attacks |
damage-ability | ABILITY | ABILITY_HIT, DAMAGE | Spell abilities |
Basic Usage
Core Parameters
Duration in ticks that the target is immune to this specific damage instance. Prevents multi-hitting.
Prefix for the damage immunity aura name. Use different IDs for damage that should bypass each other’s immunity.
Force generation of a new random ID for this damage instance.
Source type of the damage (informational).
Type of damage. Defaults to damage_source if not specified.
Callback Parameters
Metaskill executed before damage calculation. Use to modify the
damage variable.Metaskill executed after damage mods but before damage is dealt.
Metaskill executed after damage is dealt.
Random ID System
Each damage instance gets a unique random ID to prevent multi-hitting:setRandomID.yml:2
damage_core.yml:69
Damage Initialization
damage_core.yml:1
Hit Tracking
Track multiple entities hit by the same ability:damage_core.yml:14
Percentage Damage Display
Damage is calculated as a percentage of base damage:damage_core.yml:18
Damage Indicators
Floating text displays showing damage dealt:damage_core.yml:39
Indicator Scaling
Damage indicators automatically scale based on damage:- 50% damage or less: Scale 0.4-1.0x
- 100% damage: Scale 1.0x
- 200% damage or more: Scale 1.0-4.0x
Critical Hit Effects
damage_core.yml:26
Modifier Integration
The damage core triggers modifiers at key points:damage_core.yml:21
damage_core.yml:81
Example: Basic Damage
Example: Scaled Damage
frost_shard-hit_entity.yml:31
Example: Multi-Target Tracking
Example: Custom Damage Indicator
Ability-Specific Features
damage-ability includes additional effects:
damage_core.yml:121
Sudo Damage
For advanced use cases,damage-sudo executes damage from the parent entity:
damage_core.yml:135
Related Systems
- Spell Casting Handler - Integrates damage with spell system
- Modifier Handler - Modify damage with buffs/debuffs
- Knockback Core - Add knockback to damage hits
- Melee Core - Vanilla-accurate melee damage