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!

Line 17: Line 17:
  
 
== Usage ==
 
== Usage ==
The syntax of this template is <code><nowiki>{{Health|<number>}}</nowiki></code>. If the value given is <code>0</code> or lower, it will display an empty heart icon, and if the value is higher than <code>10</code>, it will display <code><nowiki>n × <health></nowiki></code> where <code>n</code> is the number you specified. It can also round to the nearest integer.
+
The syntax of this template is <code><nowiki>{{Health|<number>|<size>|hardcore=true?}}</nowiki></code>. If the value is higher than <code>10</code>, it will display <code><nowiki>n × <health></nowiki></code> where <code>n</code> is the number you specified.
  
 
== Examples ==
 
== Examples ==
Line 31: Line 31:
 
* <code><nowiki>{{Health|9}}</nowiki></code> → {{Health|9}}
 
* <code><nowiki>{{Health|9}}</nowiki></code> → {{Health|9}}
 
* <code><nowiki>{{Health|10}}</nowiki></code> → {{Health|10}}
 
* <code><nowiki>{{Health|10}}</nowiki></code> → {{Health|10}}
----
+
 
* <code><nowiki>{{Health|0}}</nowiki></code> → {{Health|0|hardcore=true}}
+
Hardcore variants:
* <code><nowiki>{{Health|1}}</nowiki></code> → {{Health|1|hardcore=true}}
+
* <code><nowiki>{{Health|0|hardcore=true}}</nowiki></code> → {{Health|0|hardcore=true}}
* <code><nowiki>{{Health|2}}</nowiki></code> → {{Health|2|hardcore=true}}
+
* <code><nowiki>{{Health|1|hardcore=true}}</nowiki></code> → {{Health|1|hardcore=true}}
* <code><nowiki>{{Health|3}}</nowiki></code> → {{Health|3|hardcore=true}}
+
* <code><nowiki>{{Health|2|hardcore=true}}</nowiki></code> → {{Health|2|hardcore=true}}
* <code><nowiki>{{Health|4}}</nowiki></code> → {{Health|4|hardcore=true}}
+
* <code><nowiki>{{Health|100|hardcore=true}}</nowiki></code> → {{Health|100|hardcore=true}}
* <code><nowiki>{{Health|5}}</nowiki></code> → {{Health|5|hardcore=true}}
 
* <code><nowiki>{{Health|6}}</nowiki></code> → {{Health|6|hardcore=true}}
 
* <code><nowiki>{{Health|7}}</nowiki></code> → {{Health|7|hardcore=true}}
 
* <code><nowiki>{{Health|8}}</nowiki></code> → {{Health|8|hardcore=true}}
 
* <code><nowiki>{{Health|9}}</nowiki></code> → {{Health|9|hardcore=true}}
 
* <code><nowiki>{{Health|10}}</nowiki></code> → {{Health|10|hardcore=true}}
 
* <code><nowiki>{{Health|100}}</nowiki></code> → {{Health|100|hardcore=true}}
 
* <code><nowiki>{{Health|4.5}}</nowiki></code> → {{Health|4.5|hardcore=true}}
 
  
 
Rounding examples:
 
Rounding examples:
Line 55: Line 47:
 
* <code><nowiki>{{Health|30}</nowiki></code> → {{Health|30}}
 
* <code><nowiki>{{Health|30}</nowiki></code> → {{Health|30}}
 
* <code><nowiki>{{Health|600}}</nowiki></code> → {{Health|600}}
 
* <code><nowiki>{{Health|600}}</nowiki></code> → {{Health|600}}
 +
 +
Custom icon size:
 +
* <code><nowiki>{{Health|6|16x16px}}</nowiki></code> → {{Health|6|16x16px}}
 
</noinclude>
 
</noinclude>

Revision as of 17:14, 10 October 2022

About

This template serves to display health points in a page.

Usage

The syntax of this template is {{Health|<number>|<size>|hardcore=true?}}. If the value is higher than 10, it will display n × <health> where n is the number you specified.

Examples

  • {{Health|0}} → 0 (♥)
  • {{Health|1}} → 1 (♥)
  • {{Health|2}} → 2 (♥)
  • {{Health|3}} → 3 (♥♥)
  • {{Health|4}} → 4 (♥♥)
  • {{Health|5}} → 5 (♥♥♥)
  • {{Health|6}} → 6 (♥♥♥)
  • {{Health|7}} → 7 (♥♥♥♥)
  • {{Health|8}} → 8 (♥♥♥♥)
  • {{Health|9}} → 9 (♥♥♥♥♥)
  • {{Health|10}} → 10 (♥♥♥♥♥)

Hardcore variants:

  • {{Health|0|hardcore=true}} → 0 (♥)
  • {{Health|1|hardcore=true}} → 1 (♥)
  • {{Health|2|hardcore=true}} → 2 (♥)
  • {{Health|100|hardcore=true}} → 100 (50 × ♥)

Rounding examples:

  • {{Health|1.25}} → 1.25 (0.625 × ♥)
  • {{Health|1.5}} → 1.5 (0.75 × ♥)
  • {{Health|1.75}} → 1.75 (0.875 × ♥)

More than 20 health points:

  • {{Health|20.5}} → 20.5 (10.25 × ♥)
  • {{Health|30} → 30 (15 × ♥)
  • {{Health|600}} → 600 (300 × ♥)

Custom icon size:

  • {{Health|6|16x16px}} → 6 (♥♥♥)