/nbt Badprenup Health 5 - Changes Badprenup's current health to 5 health points. Does not modify maximum health.
/nbt TheGoldenJ MaxHealth 40 - Changes TheGoldenJ's maximum health to 40 points. Requires a new NBT tag, but this suggestion would probably require one anyway.
/nbt TheGoldenJ ActiveEffects[(8,0,600,1,0) - Gives TheGoldenJ Jump Boost I for 30 seconds. It's easier to use /effect, but this shows how nested NBT could be used.
Sounds like the /data command to me. Also, the health and maxHealth can already changed by modifying the 'Health' and 'Attributes.Base' respectively. The /health command is actually meant for players whose NBT data can't be changed.
Support, but I would break it into 2 commands (one for health and one for max health) and use the tilde key for relative values, similar to how /tp works. Examples:
/health Badprenup 15
Sets my health at 15, regardless of what it was before (unless maxHealth is a value lower than 15, then is set to maxHealth value)
/health Badprenup ~3
Adjusts my health to be 3 points higher than what it was when the command was executed (if I had 10 HP I would go to 13 HP). AKA adds 3 HP
/health Badprenup ~-5
Adjusts my health to be 5 points lower than what it was when the command was executed (if I had 10 HP I would go to 5 HP). AKA subtracts 5 HP
And then the same thing with a /maxHealth version for adjusting maximum HP
I partially agree with you. Now thinking about it, 'heal' and 'damage' sub-commands should definitely merged (let's called it 'change') where negative values represent damage. Not too sure about merging the 'set' sub-command and using tilde key to represent relative values, because how would it work when reading values from scoreboard/nbt?
This is how the syntax plays out in my head:
health set/change/setMax <selector> value/from
IF player chooses 'value' option:
Just provide the value
IF player chooses 'from' option, it would be followed by one of these 4 options:
score <selector> <scoreboard objective>
storage(just implemented in 1.15) <storage> <path>
block <x> <y> <z> <NBT path>
entity <selector> <NBT path>
To heal everyone by the no. of levels they have:
/execute as @a run health change @s from entity @s XpLevel
To set everyone's maxHealth to be equal to their current health (No Healing!):
/execute as @a run health setMax @s from entity @s Health