When multiple items with the attribute modifier maxHealth are equip in different slots and one of these items uses a flat + or - and the other uses percentages, the math and what transpires after does not seem to behave as intended.
In the screenshots below, we have two items that add maxHealth modifiers to the player, a chestplate that when equip adds +20 max health (or another row of hearts) and then a diamond that when equip in the offhand, increases max health by 100%.
When the chestplate is equip, another 10 hearts is added, as intended. Now, in theory, since the diamond adds 100% max health, we should have 4 rows of hearts, or 40 hearts, since the total after the chestplate is 20 hearts, and 100% of 20 is 20, so it should equal 40 hearts.
Well, this does not happen. After the diamond is equip, there is no change at all, it remains at the same 20 hearts, or two rows. Interestingly enough, when the diamond is taken off, the max health goes back to 10 hearts, or one row, despite the chestplate remaining on. This is odd because you can easily add modifiers that increase it to 80 hearts if you so desire.
Interestingly, this also happens in reverse; if the diamond is equip, 10 hearts is added, but if you try to equip the chestplate, which in theory should add another flat row of health, resulting in 30 hearts or 3 rows, but it does not, again nothing occurs. And if you remove the chestplate, your health goes back to 10 hearts despite the diamond being equip.
1. Create an item adds a flat amount of maxHealth, say +20 hearts.
2. Create another item that adds a percentage of maxHealth, say 100%.
3. Equip both, one after the other.