Difference between revisions of "Template:Hunger"

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!

(Updated sizing spec as with Template:Health)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{{1}}} ({{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]] | {{#ifexpr: {{{1}}} = 0 or {{{1}}} < 0 | [[File:ui-hunger-empty.png|12x12px|class=item-icon pixel|link=Hunger]]}}}}{{#ifexpr: {{{1}}} > 1.5 or {{{1}}} = 1.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 2.5 or {{{1}}} = 2.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 3.5 or {{{1}}} = 3.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 4.5 or {{{1}}} = 4.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 5.5 or {{{1}}} = 5.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 6.5 or {{{1}}} = 6.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 7.5 or {{{1}}} = 7.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 8.5 or {{{1}}} 8.5 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 9.5 and {{{1}}} < 10 or {{{1}}} = 9.5 or {{{1}}} = 10 | [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]] | {{{1}}} × [[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}})<noinclude>
+
<includeonly>{{#switch: {{{1}}}
== About ==
+
| 0 = 0 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}-empty.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|0 hunger points]])
This template serves to display hunger points in a page.
+
| 1 = 1 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|1 hunger point]])
 
+
| 2 = 2 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|2 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|2 hunger points]])
== Usage ==
+
| 3 = 3 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|3 hunger points]])
The syntax of this template is <code><nowiki>{{Hunger|<number>|<poisoned>?}}</nowiki></code>. If the value given is <code>0</code> or lower, it will display nothing, and if the value is higher than <code>10</code>, it will display 10 hunger icons. It can also round to the nearest integer. When using the <code>poisoned</code> parameter with the <code>true</code> value, all hunger icons will change to it's poisoned version.
+
| 4 = 4 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|4 hunger points]])
 
+
| 5 = 5 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|5 hunger points]])
== Examples ==
+
| 6 = 6 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|6 hunger points]])
* <code><nowiki>{{Hunger|0}}</nowiki></code> → {{Hunger|0}}
+
| 7 = 7 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|7 hunger points]])
* <code><nowiki>{{Hunger|1}}</nowiki></code> → {{Hunger|1}}
+
| 8 = 8 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|8 hunger points]])
* <code><nowiki>{{Hunger|2}}</nowiki></code> → {{Hunger|2}}
+
| 9 = 9 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|9 hunger points]])
* <code><nowiki>{{Hunger|3}}</nowiki></code> → {{Hunger|3}}
+
| 10 = 10 ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]][[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|10 hunger points]])
* <code><nowiki>{{Hunger|4}}</nowiki></code> → {{Hunger|4}}
+
| #default = {{{1}}} ([[File:ui-hunger{{#ifeq: {{{poisoned}}}|true|-poisoned}}.png|{{{2|12}}}x{{{2|12}}}px|class=item-icon pixel|alt=🛡|link=|1 hunger point]] × {{{1}}})
* <code><nowiki>{{Hunger|5}}</nowiki></code> → {{Hunger|5}}
+
}}</includeonly><noinclude>
* <code><nowiki>{{Hunger|6}}</nowiki></code> → {{Hunger|6}}
+
{{Documentation}}
* <code><nowiki>{{Hunger|7}}</nowiki></code> → {{Hunger|7}}
+
<!-- Put categories/interwiki on the documentation page. -->
* <code><nowiki>{{Hunger|8}}</nowiki></code> → {{Hunger|8}}
 
* <code><nowiki>{{Hunger|9}}</nowiki></code> → {{Hunger|9}}
 
* <code><nowiki>{{Hunger|10}}</nowiki></code> → {{Hunger|10}}
 
 
 
Rounding examples:
 
* <code><nowiki>{{Hunger|1.25}}</nowiki></code> → {{Hunger|1.25}}
 
* <code><nowiki>{{Hunger|1.5}}</nowiki></code> → {{Hunger|1.5}}
 
* <code><nowiki>{{Hunger|1.75}}</nowiki></code> → {{Hunger|14}}
 
 
 
Poisoned examples:
 
* <code><nowiki>{{Hunger|5|poisoned=true}}</nowiki></code> → {{Hunger|5|poisoned=true}}
 
* <code><nowiki>{{Hunger|6.5|poisoned=true}}</nowiki></code> → {{Hunger|6.5|poisoned=true}}
 
* <code><nowiki>{{Hunger|3|poisoned=true}}</nowiki></code> → {{Hunger|3|poisoned=true}}
 
 
</noinclude>
 
</noinclude>

Latest revision as of 14:09, 11 July 2023

Template-info.png Template documentation Note: parts of or the entire template might not be visible without values provided.

About

This template serves to display hunger points in a page.

Usage

The syntax of this template is {{Hunger|<number>|<poisoned>?}}. If the value given is 0 or lower, it will display nothing, and if the value is higher than 10, it will display 10 hunger icons. It can also round to the nearest integer. When using the poisoned parameter with the true value, all hunger icons will change to it's poisoned version.

Examples

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

Rounding examples:

  • {{Hunger|1.25}} → 1.25 (🛡 × 1.25)
  • {{Hunger|1.5}} → 1.5 (🛡 × 1.5)
  • {{Hunger|14.75}} → 14.75 (🛡 × 14.75)

Poisoned examples:

  • {{Hunger|5|poisoned=true}} → 5 (🛡🛡🛡🛡🛡)
  • {{Hunger|6.5|poisoned=true}} → 6.5 (🛡 × 6.5)
  • {{Hunger|3|poisoned=true}} → 3 (🛡🛡🛡)