Template:Inventory slot/doc

The inventory slot template creates an interface element which looks and acts like an in-game inventory slot.

Item Syntax
(This wiki's Item Syntax follows the Basic UI Framework, modeled after the inventory slot framework of the Minecraft Wiki first seen in 2014.)

The first parameter should supply a string in the Item Syntax. To define a single item:
 * Each of the five parameters can be defined using [ Title ] Image : Name, Amount [ Description ]
 * Name must be present; All other parameters are optional.
 * If the rules above are not observed, the program will by default treat the whole input string as item
 * The punctuations : ; [ ] (colon, semicolon, left/right square brackets) must be escaped as \: \; \[ \] to be correctly treated as text within a value.
 * Parameters like link, title, and text accepts none to disable the feature.

First, creates an empty slot: Now, we add an item. By default, the whole string will be treated as the item: Now see this example. We use the proper syntax to allow us to define more things. Each available parameter will be explained later. Results in:
 * Some Examples

Multiple items can be defined separated by ;. Those items will display in an animation cycle. For example: Results in:
 * Multiple Items

Predefined item variants can be invoked by preceding item with * (for normal sequence) or ? (for randomized sequence). For example: gets expanded into Results in:
 * Item Variants

Parameters available to an item definition are explained below:
 * - The item name, which represents the default link, image, and tooltip title.
 * (optional) - The stack number. Best used to display a single number M or a number range M-N. Theoretically can display any text.
 * (optional) - Changes the image displayed. For any slot, an image file will be expected. The default expected image name is < Name >.png.
 * (optional) - Tooltip title to show on mouseover. See tooltip formatting. Accepts %inherit% to retrieve whole value from predefined tooltips. The default is the item name.
 * (optional) - Tooltip text to show on mouseover. See tooltip formatting. Accepts %inherit% to retrieve whole value from predefined tooltips.

Full Syntax
item1[; item2; ...]


 * - The first parameter is the name of the item(s) or item declaration(s).
 * The item name, link, title, text and image can be displayed accordingly to what is predefined (See ).
 * All of the above can be overridden with calling Slot with additional parameters.
 * Additional information, Amount can be appended to the name of the item. The number will be displayed at the bottom-right corner of a slot.
 * Multi-frame slot can be typed in display sequence and delimited by ;; they will be display one after another if JavaScript is enabled.
 * (optional) - Image always shown under the main image
 * (optional) - Sets the vertical alignment
 * (optional) - Overrides the link
 * (optional) - Title to show on mouseover
 * (optional) - Text to show on mouseover
 * (optional) - Adds additional classes to the .invslot class
 * (optional) - Adds styling to the .invslot
 * (optional) - Adds styling to the .invitem
 * (optional) - Adds styling to the stack number

Tooltip Formatting
The title and text accepts Color/Formatting Codes specified in w:c:minecraft:Formatting codes with Java version behaviour, with the following rules:
 * Use & followed by a letter representing a Color/Formatting Code. The specified color/formatting(s) will affect the rest of the string. For example, &c starts a string colored in red, and &a&l starts a string colored in green and in bold font.
 * When going into a new line or when &r is used, all previous Color/Formatting Codes are discarded.
 * When using a color code (-, -), all previous formatting code are discarded.
 * A new line can be inserted with /.
 * In title and text, the ampersand and the forward slash & / must be escaped as \& \/ to be treated correctly as normal text.

Predefined Tooltips
The following modules manage all predefined tooltips:
 * General Tooltip Definition - Module:Inventory slot/Tooltips
 * Item Templates Definition - Module:Inventory slot/Templates
 * Other Aliases/Final Processor - Module:Inventory slot/Aliases

All predifined tooltips can be accessed through the item name. Default values will be first be retrieved, and can be overridden by those defined in Item Syntax or Full Syntax.

The following modules manage predefined item variants:
 * Item Variants - Module:Item/Variants

Some special usage convensions for Slot:
 * Pet Tooltips with Rarity: ' ' (Example 'Monkey Pet (R)')
 * Potion/Enchantment Tooltips: ' ' or 'Enchanted Book ', where can be an arabic or roman number

Some of these modules are cached to save processing time.

Attributions
Template and its Documentation initially taken from: https://minecraft.fandom.com/wiki/Template:Inventory_slot