Currently, there is no real way to change an player's health by a specific amount since you can't edit the their nbt data. Even doing so with other entities is a bit tedious.
A /health command can solve these problems easily if implemented properly.
It would have options such as 'change','set' and 'setMax' followed by a selector.
It should not only be able to do so with a provided value but also be able to read the value from a scoreboard
change - positive values heal the target capped by the maximum health. negative values damage the target and if health is reduced to 0(or less), it would just kill the target
set - It sets the health to the given value, same restrictions as 'change' apply, also trying to set health to 0 or less would default it to 1.
setMax - It sets the maximum health to given value. Basically, same as editing generic.maxHealth attribute from nbt
Syntax in spoiler:
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
storage(just implemented in 1.15)
block
entity
Examples:
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
EDIT : Included examples and tweaked the suggestion to be updated with latest post
Even though we have the /effect command which we could use for healing/saturation I'd still support a /heal command. I'd like it to be clientside but I'd see it being used more for server commands.
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
Want some advice on how to thrive in the Suggestions section? Check this handy list of guidelines and tips for posting your ideas and responding to the ideas of others!
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
Honestly, I'd just make it a /nbt command:
/nbt <target> <tag> <value>
/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.
/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[0].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>
Examples:
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
Currently, there is no real way to change an player's health by a specific amount since you can't edit the their nbt data. Even doing so with other entities is a bit tedious.
A /health command can solve these problems easily if implemented properly.
It would have options such as 'change','set' and 'setMax' followed by a selector.
It should not only be able to do so with a provided value but also be able to read the value from a scoreboard
change - positive values heal the target capped by the maximum health. negative values damage the target and if health is reduced to 0(or less), it would just kill the target
set - It sets the health to the given value, same restrictions as 'change' apply, also trying to set health to 0 or less would default it to 1.
setMax - It sets the maximum health to given value. Basically, same as editing generic.maxHealth attribute from nbt
Syntax in spoiler:
IF player chooses 'value' option:
IF player chooses 'from' option, it would be followed by one of these 4 options:
Examples:
To heal everyone by the no. of levels they have:
To set everyone's maxHealth to be equal to their current health (No Healing!):
EDIT : Included examples and tweaked the suggestion to be updated with latest post
Perseverance always pays. Sooner or later.
I completely agree with this command idea! This would be so useful for many players!
Full Support.
Hey guys I'm James, I used to be a noob but now I'm not, I finally figured out how to use TextCraft so here's a banner for one of my suggestions.
This would definitely be a huge help, considering I'm working on a beefy map right now.
Total support!
[Avatar] A render of my skin
[Status] Doing absolutely nothing.
I'm Idelac. I'm a regular on the forum games.
https://www.youtube.com/watch?v=3b48-Z_ozdg
Support; this is one of the many things that should've really been added laready.
My suggestions: Enhancements - Throwable Fire Charges - On Phantoms and Elytra. Also check out The Minecraftian Language. This signature is not here to waste your space.
Sadly, the feedback site keeps rejecting this idea
Perseverance always pays. Sooner or later.
Even though we have the /effect command which we could use for healing/saturation I'd still support a /heal command. I'd like it to be clientside but I'd see it being used more for server commands.
SUPPORT
Niche Community Content Finder, Youtuber, Modpack/Map Maker, Duck
Forum Thread Maintainer for APortingCore, Liteloader Download HUB, Asphodel Meadows, Fabric Project, Legacy Fabric/Cursed Fabric, Power API, Rift/Fabric/Forge 1.13 to 1.17.
Wikis I Maintain: https://modwiki.miraheze.org/wiki/User:SuntannedDuck2
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
Want some advice on how to thrive in the Suggestions section? Check this handy list of guidelines and tips for posting your ideas and responding to the ideas of others!
http://www.minecraftforum.net/forums/minecraft-discussion/suggestions/2775557-guidelines-for-the-suggestions-forum
Honestly I'd just mak
Honestly, I'd just make it a /nbt command:
/nbt <target> <tag> <value>
/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.
Want to see my suggestions? Here they are!
I am also known as GameWyrm or GameWyrm97. You can also find me at snapshotmc.com
Sounds like the /data command to me. Also, the health and maxHealth can already changed by modifying the 'Health' and 'Attributes[0].Base' respectively. The /health command is actually meant for players whose NBT data can't be changed.
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:
IF player chooses 'value' option:
IF player chooses 'from' option, it would be followed by one of these 4 options:
Examples:
To heal everyone by the no. of levels they have:
To set everyone's maxHealth to be equal to their current health (No Healing!):
Perseverance always pays. Sooner or later.