The Lord of the Rings Minecraft Mod Wiki

0 ( 0 )

Renew this page to show changes

Template documentation follows
Note: the template above may sometimes be partially or fully invisible.
Visit Template:Bar_main/doc to edit this documentation. (How does this work?)


This template creates a bar of similar icons.

It is the basic version of the bar templates and called by the more comfortable {{Bar}} template. It uses the {{Bar simple}} template.

It handles

  • Putting tags around the simple bar(s).
  • Displaying a range of values.

It handles not

  • Missing parameters -> Has to be done by calling template.
  • Displaying plain text if non-numeric -> Has to be done by calling template.
  • Price ranges -> Has to be done by calling template.
  • Avoid the whole display wrapping around lines -> Has to be done by calling template.
  • Display the bar of icons itself -> Uses the {{Bar simple}} template for that.


Type {{Bar main|<type>|<number>|<options>}} somewhere.

  • <type> is the basic filename e.g. armour. The user must first provide a couple of images in advance: 0armour.png, 1armour.png, ..., 10armour.png to be able to display the respective icon bar. The images (at least that for 10) must have a small clear left margin, so when joined together, they look equally distributed. Defaut is hearts. There is a special display for coins.
  • <number> is the number of icons to be displayed. The number must be numeric and will be rounded to the nearest integer. Default is 0. Causes error, when non-numeric! The <number> can also be a range of two numbers 17-23 and then will dispay two bars for the respective numbers.
  • <options> the options are so far:
    • ext=<extension> extension of the filename .jpg, .gif, ... default is .png
    • size=<size> height of the bar in px. Default is original size.
      You can also use a symbolic name here, like infobox, which selects a predefined size as defined in the {{Bar height}} template.
    • notag=1 to suppress the number tag around the bar. Default is tag shown.
    • tooltip=<text> to define the text, which is shown, when hovering over the bar, default is the <number> parameter.
    • link=<text> to define the link, where the bar links to. Defaults are defined in the {{Bar link}} template.


type this to get this
{{Bar main}}
No parameters -> defaut type and number.
0 ( 0 )
{{Bar main||4}}
No type -> defaut type.
4 ( 4 )
{{Bar main|hearts}}
No number -> default number.
0 ( 0 )
{{Bar main|hearts|some text}}
Non numeric -> error.
some text (Expression error: Unexpected < operator.)
{{Bar main|hearts|6.9}}
Rounding numbers to next integer.
6.9 ( 6.9 )
{{Bar main|food|83.5}}
Large numbers -> compacted display.
83.5 (42 x  83.5 )
{{Bar main|coins|243.7}}
Coins -> special display.
243.7 ( 243.7  243.7  243.7 )
{{Bar main|hearts|4-8}}
Range defined.
4-8 ( 4  to  8 )
{{Bar main|food|2+4.2 - 8+2-1}}
Even equations (except for -).
2+4.2 - 8+2-1 ( 2+4.2  to  8+2-1 )
{{Bar main||5|ext=.jpg}}
Extension specified -> not .png.
5 ( 5 )
{{Bar main|armour|8.3|size=9}}
Different size.
8.3 ( 8.3 )
{{Bar main|armour|5|size=infobox}}
Predefined size.
5 ( 5 )
{{Bar main|food|4.3|notag=1}}
Tag suppressed -> no # ().
{{Bar main||10|tooltip=my health}}
Tooltip defined.
10 ( my health )
{{Bar main|coins|2345|link=Corn}}
Link defined.
2345 (23 x  2300  +  45  45 )}