Set Max Health To 40 Hearts
Give yourself 20 permanent extra hearts
✅ Verified for Java 26.2 · Bedrock 26.32 — checked June 2026Sets 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 4046 characters
- Java: yes
- Bedrock: no
- Command block: yes
- Needs cheats / OP: yes
How to use
- Open chat (T on Java, / on Bedrock).
- Paste the command and press Enter.
- Your health bar expands to 20 hearts.
- You now take longer to defeat in combat.
Related commands
Switch to Peaceful mode so hostile mobs don't spawn
/difficulty peaceful