Template:Inventory slot
These scripts are written in Lua.
The inventory slot template creates an interface element which looks and acts like an in-game inventory slot.
The images used have the Invicon <item name>.png name format, or Grid <item name> (<mod name>).png in case of mods (which are currently being phased out). GIF files are also supported for animated icons.
Usage
All inputs are optional:
{{Slot
|[Title]Mod:Name,Amount[Description]; [Title2]Mod2:Name2,Amount2[Description2]; ...
|mod=Default mod (useful for animations and layout templates)
|default=Image always shown under the main image
|align=Vertical Alignment
|link=Link override
|title=Text show on mouseover
|class=Adds additional classes to the .invslot class
|style=Adds styling to the .invslot
|imgclass=Adds additional classes to the .invslot-item
|numstyle=Adds styling to the stack number
}}
Parts
The first parameter is a special parameter consisting of various "parts" grouped together in frames (delimited by ;) which will be display one after another if JavaScript is enabled. Every part is optional, but without "name", won't do anything. The "name" can also include the image's extension following a dot (.png or .gif).
Simple example
To display an inventory item of "Raw Porkchop" with an stack size of 20 you would put: {{Slot|High Quality Magic Crystal,20}}
- shows
An amount of 2–999 is supported, anything else will not be displayed.
Subframes
Subframes are shown as a single frame, but the frames within it are advanced every time the subframe is displayed. A set of frames can be put in a subframe by wrapping it in braces.
Here, an alias (which resolves to multiple frames) is wrapped in a subframe, and a different wood plank variant is shown each animation cycle:
{{Slot|{Any Planks};Iron Ingot}}
- shows
Align
Align uses the vertical-align CSS property. For example to align to the middle:
Smells like {{Slot|Raw Porkchop|align=middle}} in here!
- shows
Default
Default is always shown and is placed under the image. {{Slot|default=Brewing}}{{Slot|Mundane Splash Potion|default=Brewing}}
- shows
Link
To change the link for all frames from the image name put: {{Slot|Charcoal|link=Coal#Charcoal}}
- shows
To remove the link, set link to none: {{Slot|Charcoal|link=none}}
- shows
Note that this retains the title.
Other templates
These templates implement this template into a GUI screen which mimics how it would look in Minecraft. Thus, they have mostly the same features as this template.
{{Crafting Table}}{{Inventory Table}}{{Furnace}}{{Brewing Stand}}{{Stonecutter}}{{Loom}}{{Grindstone}}{{Hotbar}}{{Inventory}}{{Inventory slot}}- Module:UI