Guide 1 Docs 2 Reference 3

Field of Player

player.max_health

Their health now, 0 to max_health; nil where the game version has no damage rules. Writable: set outright, no flash; 0 is a death; a number above max_health stops there. The most health they can have: 20 unless a pack set it; nil where the game version has no damage rules. Writable, 1 to 1024; nil gives the game's own back. A lower maximum takes health down to it. It lasts for the session. Every Java client draws its hearts; Bedrock draws none.

player.max_health: number?

Used in