Skip to content
[/craft]

Set Max Health To 40 Hearts

Give yourself 20 permanent extra hearts

✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026

Sets your maximum health to 40 (20 hearts) instead of the default 20 (10 hearts). This is useful for creating harder survival challenges or testing damage mechanics. Changes persist until reset.

/attribute @s minecraft:max_health base set 40
46 characters

How to use

  1. Open chat (T on Java, / on Bedrock).
  2. Paste the command and press Enter.
  3. Your health bar expands to 20 hearts.
  4. You now take longer to defeat in combat.

Related commands

Switch yourself into Creative mode

/gamemode creative

Switch to Peaceful mode so hostile mobs don't spawn

/difficulty peaceful

Give yourself or a player XP levels

/xp add @s 10L

Trigger a thunderstorm with lightning

/weather thunder 600

Make it nighttime immediately

/time set night

See the world seed for reproducibility or map info

/seed