This custom enchantment allow a player to reduce the raw received damage. If "full_armor", option is true, the player needs to wear all armor pieces to activate this effect. If "full_armor" is false, any worn armor pieces with this enchantment will trigger the protection.
The amount of damage reduction is calculated based on the enchantment level of each armor piece. Each armor piece can reduce the damage up to 1/4th of the original raw damage. This means if you wear all armor pieces and if all pieces have the max enchantment level, you can effectively cancel the damage (if the "multiplier" option is set to 1.0).
This custom enchantment is a polymorphic enchantment and you can define many GodProtection variants in the GodProtection_config.yml with different sets of causes and multipliers and full_armor options.
description: "Protect you from receiving damage!"
# the reduced raw damage will be calculated based on each armor item you're wearing
# each worn armor can reduce the damage by original_damage * 0.25 * (1.0 - multiplier * level/maxlevel)
# this means, if you wear full armor with max level, you can cancel the damage with the multiplier 1.0.
# if "ALL" is specified or nothing is specified, all causes will be prevented.
# you can list causes available in https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html