Template:Hp

From Terraria Wiki
Jump to navigation Jump to search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for templates to learn more.
See Template:Hp/l10n for the localization of this template.
Template-info.svg Documentation The documentation below is transcluded from Template:Hp/doc. (edit | history)

A template that displays health values in a similar fashion to Terraria.

Usage

{{ hp | <health value> | small = 0/1 (optional) | link = 0/1 (optional) }}

ParameterDescriptionTypeStatus
Health value1
Health value to display.
Example:
150
Number
required
Compressedsmall
Reduces the display to a compact format, useful when space is an issue.
Auto value:
False (0)
Boolean
optional

This template prefers inline formatting of parameters.

Examples

Code Result
{{ hp | 100 }}
PlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
{{ hp | 100 | small = 1 }}
Heart.png × 5
{{ hp | 100 | link = 1 }}
PlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
{{ hp | 460 }}
PlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart2.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.pngPlayerHeart.png
{{ hp | 460 | small = 1 | link = 1 }}
Heart.png × 20 + Life Fruit.png × 12

Notes

  • The standard form of the template cannot round values and does not account for the Lifeforce Potion. Between 0 and 400, use increments of 20. Between 400 and 500, increments of 5.
    • The small parameter will allow rounded values, but rounds down regardless of value, i.e, {{hp|119|small=1}} returns
      Heart.png × 5