Help with understanding how damage works?

I’ve read through a few docs, but it seems information on the way damage works is rather lackluster at the moment. Unless I’m missing something.

Anyway, what I’d like to know is the relationship between DamageTypes and Enchantments.

Is it that Enchantments like Fire Protection and Feather Falling reduce damage from the FIRE and FALL damage types? If so, does the Protection enchantment protect from both of these ( and every other ), or only the ATTACK DamageType?

And in fact, is there a comprehensive map between DamageTypes and Enchantments that describes which enchantments are responsible for mitigating the damage from which damagetypes?

Furthermore, how do DamageModifiers tie into all of this? What do they represent, and how do they change the incoming damage?

First, read the javadocs, the read these gists as the partially give an example of how it works:

And a listener for you to use as a frame of reference:

3 Likes

@Inscrutable
Would you deem this “docs-able”? Seems like something that might come to be useful for developers.

1 Like

If you want to write up something that explains it, go ahead, assemble a PR. The SpongeDocs has a system for directly referencing Javadocs too.

1 Like

Fantastic, would love to contribute :slight_smile:

1 Like