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!

(Display the empty hunger icon if value is equal or lower than 0, and added possibilty to change normal hunger icons for the poisoned one if using the parameter "poisoned")
(Updated sizing spec as with Template:Health)
Β 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
βˆ’
{{#ifexpr: {{{1}}} > 0 | [[File:ui-hunger{{#if: {{{poisoned}}}|-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.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 2.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 3.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 4.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 5.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 6.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}{{#ifexpr: {{{1}}} > 7.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}{{#ifexpr: {{{1}}} > 8.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}
+
<includeonly>{{#switch: {{{1}}}
βˆ’
{{#ifexpr: {{{1}}} > 9.49 | [[File:ui-hunger{{#if: {{{poisoned}}}|-poisoned}}.png|12x12px|class=item-icon pixel|link=Hunger]]}}<noinclude>
+
| 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]])
βˆ’
== About ==
+
| 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]])
βˆ’
This template serves to display hunger points in a page.
+
| 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]])
βˆ’
Β 
+
| 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]])
βˆ’
== Usage ==
+
| 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]])
βˆ’
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 (no value required), all hunger icons will change to it's poisoned version.
+
| 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]])
βˆ’
Β 
+
| 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]])
βˆ’
== Examples ==
+
| 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|0}}</nowiki></code> β†’ {{Hunger|0}}
+
| 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|1}}</nowiki></code> β†’ {{Hunger|1}}
+
| 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|2}}</nowiki></code> β†’ {{Hunger|2}}
+
| 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|3}}</nowiki></code> β†’ {{Hunger|3}}
+
| #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|4}}</nowiki></code> β†’ {{Hunger|4}}
+
}}</includeonly><noinclude>
βˆ’
* <code><nowiki>{{Hunger|5}}</nowiki></code> β†’ {{Hunger|5}}
+
{{Documentation}}
βˆ’
* <code><nowiki>{{Hunger|6}}</nowiki></code> β†’ {{Hunger|6}}
+
<!-- Put categories/interwiki on the documentation page. -->
βˆ’
* <code><nowiki>{{Hunger|7}}</nowiki></code> β†’ {{Hunger|7}}
Β 
βˆ’
* <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|1.75}}
Β 
βˆ’
Β 
Β 
βˆ’
Poisoned examples:
Β 
βˆ’
* <code><nowiki>{{Hunger|5|Poisoned}}</nowiki></code> β†’ {{Hunger|5|Poisoned}}
Β 
βˆ’
* <code><nowiki>{{Hunger|6.5|Poisoned}}</nowiki></code> β†’ {{Hunger|6.5|Poisoned}}
Β 
βˆ’
* <code><nowiki>{{Hunger|3|Poisoned}}</nowiki></code> β†’ {{Hunger|3|Poisoned}}
Β 
Β 
</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 (πŸ›‘πŸ›‘πŸ›‘)