I recently created a server from www.minefort.com, which is great, but the unfortunate thing is that those servers are unable to use forge mods, in my case, the X-life mod found here. However, I also know that the behavior of counting up hearts with death(so you have 1 heart on 0 deaths, 2 hearts on 1 death, etc.) is doable in the game with commands. To this effect, I've created a Deaths scoreboard variable which uses the in-game stats to determine how many deaths a player has. I also know that this command
/attribute @p minecraft:generic.max_health base set <insert health out of 20 here>
can be used to set health. To me, the easiest way of having that counting-up of hearts behavior would be something like
/attribute @p minecraft:generic.max_health base set 2*Deaths+2
as the health at any given amount of deaths is modeled 2 x Deaths+2, or 2(Deaths + 1). However, this does not work in a command, probably because I was kinda just guessing at the end of the command when it came to syntax. If anyone knows how to do this kind of mathematical operation in a command, it'd be greatly appreciated.
Vitality series: