A very basic mod for Minecraft 1.12.2 that adds 2 custom attributes:
Every attribute start with cool-attributes
.
.lifeStealPercentage
: Heals the player x% of the damage they deal to a mob..outOfWorldPercentage
: When a mob is damaged by the player, the mob will take an extra x% of the damage dealt but as Out of World damage type (Bypasses the mob's armor)
These attributes range from 0.0 to 1.0 (0 to 100%)
Mob refers to a living entity, like a player or a monster.
Examples:
If the player has a .lifeStealPercentage
of 0.5, and they deal 5 damage to a mob, they will heal 2.5 HP.
If the player has a .outOfWorldPercentage
of 0.2, and they deal 10 damage to a mob, the mob will take an extra 2 damage but as Out of World damage.
This mod was made as training!
You can use some code in your own project. Just don't copy the entire thing.