2

How can I decrease the maximum health of a player using commands in Minecraft 1.8?

2 Answers 2

5

This is possible using item attributes with a command like this:

replaceitem entity @p slot.armor.feet chainmail_boots 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-10,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}

What the above command does is replace one of a selected entity's armor slots (in this case their feet) with a piece of armor that has a negative maxHealth attribute, causing their maximum health to lower.

You can change the number after Amount: to change how much their health drops by; 1 unit is half a heart.

Note that their health will go back up if they take the armor piece off, so you will probably want to have the command on a clock.

-1

and for a button and only 1 heart, use this: replaceitem entity @p slot.armor.head stone_button 1 0 {AttributeModifiers:[{AttributeName:"generic.maxHealth",Name:"generic.maxHealth",Amount:-18,Operation:0,UUIDMost:12272,UUIDLeast:110438}]}

1
  • 1
    This adds nothing new and is essentially just a copy/paste of the accepted answer.
    – Skylinerw
    Commented Aug 26, 2016 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.