Difference between revisions of "Template:Health"

From Mine Blocks Wiki
Jump to navigation Jump to search
If you find a typo, inconsistency, or error, please sign up and help out the wiki! We can't do it without your help! :D Thank you!

(Half a heart = 1hp)
Line 34: Line 34:
 
* <code><nowiki>{{Health|1.75}}</nowiki></code> → {{Health|1.75}}
 
* <code><nowiki>{{Health|1.75}}</nowiki></code> → {{Health|1.75}}
  
More than 10 health points:
+
More than 20 health points:
* <code><nowiki>{{Health|10.5}}</nowiki></code> → {{Health|10.5}}
+
* <code><nowiki>{{Health|20.5}}</nowiki></code> → {{Health|20.5}}
* <code><nowiki>{{Health|15}</nowiki></code> → {{Health|15}}
+
* <code><nowiki>{{Health|30}</nowiki></code> → {{Health|30}}
* <code><nowiki>{{Health|300}}</nowiki></code> → {{Health|300}}
+
* <code><nowiki>{{Health|600}}</nowiki></code> → {{Health|600}}
 
</noinclude>
 
</noinclude>

Revision as of 13:35, 5 July 2022

{{{1}}} (Expression error: Unrecognized punctuation character "{".)

About

This template serves to display health points in a page.

Usage

The syntax of this template is {{Health|<number>}}. If the value given is 0 or lower, it will display an empty heart icon, and if the value is higher than 10, it will display n × <health> where n is the number you specified. It can also round to the nearest integer.

Examples

  • {{Health|0}} → 0 (Ui-health-empty.png)
  • {{Health|1}} → 1 (Ui-health-half.png)
  • {{Health|2}} → 2 (Ui-health.png)
  • {{Health|3}} → 3 (Ui-health.pngUi-health-half.png)
  • {{Health|4}} → 4 (Ui-health.pngUi-health.png)
  • {{Health|5}} → 5 (Ui-health.pngUi-health.pngUi-health-half.png)
  • {{Health|6}} → 6 (Ui-health.pngUi-health.pngUi-health.png)
  • {{Health|7}} → 7 (Ui-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|8}} → 8 (Ui-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|9}} → 9 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|10}} → 10 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|11}} → 11 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|12}} → 12 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|13}} → 13 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|14}} → 14 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|15}} → 15 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|16}} → 16 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|17}} → 17 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|18}} → 18 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)
  • {{Health|19}} → 19 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health-half.png)
  • {{Health|20}} → 20 (Ui-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.pngUi-health.png)

Rounding examples:

  • {{Health|1.25}} → 1.25 (Ui-health-half.png)
  • {{Health|1.5}} → 1.5 (Ui-health.png)
  • {{Health|1.75}} → 1.75 (Ui-health.png)

More than 20 health points:

  • {{Health|20.5}} → 20.5 (10.25 × Ui-health.png)
  • {{Health|30} → 30 (15 × Ui-health.png)
  • {{Health|600}} → 600 (300 × Ui-health.png)