-
Notifications
You must be signed in to change notification settings - Fork 72
Damage Side Effects
We used to have toggles named ignore-armor or prevent-knockback on some damage spells, which didn't actually just do what was in the name. Instead of dealing damage, they used to subtract health and play the "entity hurt" animation effect. Because they quite literally modified health, doing so ignored other aspects of what "dealing damage" usually would handle - they all ignored:
- armor
- knockback
- enchantments
- potion effects
- invulnerability ticks after damage was just dealt
Old damage spells, like PainSpell, have never properly dealt specific damage types despite having an option to configure the damage type (cause). Since 4.0 Beta 17 (1.21.4+), we added the DamageSpell, capable of dealing damage using vanilla damage types and handling their vanilla side effects.
If you wish to bypass specific side effects, the spell no longer provides toggles for them because the game never handled things directly that way when dealing true damage. Instead, the game checks if the damage type is tagged by a damage type tag, specifically the #bypass_(side effect) tag, to determine if it should bypass them. If you wanted to ignore invulnerability ticks, you have to use a damage type tagged by #bypasses_cooldown, but that tag is empty. Or maybe you want to bypass another side effect, but the damage type you want to use bypasses another you don't want to bypass.
Your server.properties file defines a level-name property, and that world is the main world from which player data, data packs, and other things are loaded.
In that world directory, you can create a simple data pack where you can create custom damage types you can reference in DamageSpell. Follow the Minecraft wiki for documentation on how to add new damage types, and you can also use this tool for help.
If you want to make a damage type, custom or vanilla, bypass one or more damage side effects, such as armor or knockback, you can add the damage type to one #bypass_(side effect) damage type tag. The full data pack tag documentation can be found here.
data/minecraft/tags/damage_type/bypasses_armor.json
{
"replace": false,
"values": [
"cool_server:chaos_magic"
]
}