Template:Hunger

From Mine Blocks Wiki
Revision as of 11:41, 5 July 2022 by Tobias Alcaraz (talk | contribs) (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")
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!

Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".Expression error: Unrecognized punctuation character "{".{{#ifexpr: {{{1}}} > 7.49 | Ui-hunger-poisoned.png}Expression error: Unrecognized punctuation character "{". Expression error: Unrecognized punctuation character "{".

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 (no value required), all hunger icons will change to it's poisoned version.

Examples

  • {{Hunger|0}}Ui-hunger-empty.png{{#ifexpr: 0 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|1}}Ui-hunger-poisoned.png{{#ifexpr: 1 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|2}}Ui-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 2 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|3}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 3 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|4}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 4 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|5}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 5 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|6}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 6 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|7}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 7 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|8}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 8 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|9}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 9 > 7.49 | Ui-hunger-poisoned.png}Ui-hunger-poisoned.png
  • {{Hunger|10}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 10 > 7.49 | Ui-hunger-poisoned.png}Ui-hunger-poisoned.png

Ui-hunger-poisoned.png

Rounding examples:

  • {{Hunger|1.25}}Ui-hunger-poisoned.png{{#ifexpr: 1.25 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|1.5}}Ui-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 1.5 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|1.75}}Ui-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 1.75 > 7.49 | Ui-hunger-poisoned.png}


Poisoned examples:

  • {{Hunger|5|Poisoned}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 5 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|6.5|Poisoned}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 6.5 > 7.49 | Ui-hunger-poisoned.png}
  • {{Hunger|3|Poisoned}}Ui-hunger-poisoned.pngUi-hunger-poisoned.pngUi-hunger-poisoned.png{{#ifexpr: 3 > 7.49 | Ui-hunger-poisoned.png}