Template:Inventory slot/doc: Difference between revisions

From Parallel Wiki
Jump to navigation Jump to search
(update for the post-sprite age)
(No difference)

Revision as of 16:35, 2 October 2023

This is the documentation page. It should be transcluded into the main template page. See Template:Documentation for more information
Shortcut
Lua logo.svg
This template uses Module:Inventory slot, with data stored in Module:Inventory slot/Aliases.
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|Raw Porkchop,20}}

shows

Invicon Raw Porkchop.png: Inventory sprite for Raw Porkchop in Minecraft as shown in-game linking to Raw Porkchop (Vanilla) with description: Raw Porkchop20

An amount of 2–999 is supported, anything else will not be displayed.

Aliases

Note: Banner variations are not included due to how many there are.

The above aliases can be used to shorten common items, such as all wood blocks or adding parts to certain names by default.

{{Slot|Any Log;Golden Apple}}

shows

Invicon Oak Log.png: Inventory sprite for Oak Log in Minecraft as shown in-game linking to Oak Log (Vanilla) with description: Oak LogInvicon Spruce Log.png: Inventory sprite for Spruce Log in Minecraft as shown in-game linking to Spruce Log (Vanilla) with description: Spruce LogInvicon Birch Log.png: Inventory sprite for Birch Log in Minecraft as shown in-game linking to Birch Log (Vanilla) with description: Birch LogInvicon Jungle Log.png: Inventory sprite for Jungle Log in Minecraft as shown in-game linking to Jungle Log (Vanilla) with description: Jungle LogInvicon Acacia Log.png: Inventory sprite for Acacia Log in Minecraft as shown in-game linking to Acacia Log (Vanilla) with description: Acacia LogInvicon Dark Oak Log.png: Inventory sprite for Dark Oak Log in Minecraft as shown in-game linking to Dark Oak Log (Vanilla) with description: Dark Oak LogInvicon Mangrove Log.png: Inventory sprite for Mangrove Log in Minecraft as shown in-game linking to Mangrove Log (Vanilla) with description: Mangrove LogInvicon Cherry Log.png: Inventory sprite for Cherry Log in Minecraft as shown in-game linking to Cherry Log (Vanilla) with description: Cherry LogInvicon Golden Apple.png: Inventory sprite for Golden Apple in Minecraft as shown in-game linking to Golden Apple (Vanilla) with description:


When using the alias, parts can be added which will override any parts in the alias.

{{Slot|Any Log,4;[&oShiny Apple]Enchanted Golden Apple}}

shows

Invicon Oak Log.png: Inventory sprite for Oak Log in Minecraft as shown in-game linking to Oak Log (Vanilla) with description: Oak Log4Invicon Spruce Log.png: Inventory sprite for Spruce Log in Minecraft as shown in-game linking to Spruce Log (Vanilla) with description: Spruce Log4Invicon Birch Log.png: Inventory sprite for Birch Log in Minecraft as shown in-game linking to Birch Log (Vanilla) with description: Birch Log4Invicon Jungle Log.png: Inventory sprite for Jungle Log in Minecraft as shown in-game linking to Jungle Log (Vanilla) with description: Jungle Log4Invicon Acacia Log.png: Inventory sprite for Acacia Log in Minecraft as shown in-game linking to Acacia Log (Vanilla) with description: Acacia Log4Invicon Dark Oak Log.png: Inventory sprite for Dark Oak Log in Minecraft as shown in-game linking to Dark Oak Log (Vanilla) with description: Dark Oak Log4Invicon Mangrove Log.png: Inventory sprite for Mangrove Log in Minecraft as shown in-game linking to Mangrove Log (Vanilla) with description: Mangrove Log4Invicon Cherry Log.png: Inventory sprite for Cherry Log in Minecraft as shown in-game linking to Cherry Log (Vanilla) with description: Cherry Log4Invicon Enchanted Golden Apple.gif: Inventory sprite for Enchanted Golden Apple in Minecraft as shown in-game linking to Enchanted Golden Apple (Vanilla) with description: Shiny Apple


Mods can specify an additional aliases table using the modaliases parameter.

Titles and description

The title parameter can be used to set a title for all frames.

{{Slot|Raw Porkchop; Cooked Porkchop|title=Smelly Porkchop}}

shows

Invicon Raw Porkchop.png: Inventory sprite for Raw Porkchop in Minecraft as shown in-game linking to Raw Porkchop (Vanilla) with description: Smelly PorkchopInvicon Cooked Porkchop.png: Inventory sprite for Cooked Porkchop in Minecraft as shown in-game linking to Cooked Porkchop (Vanilla) with description: Smelly Porkchop


To remove the title, set it to "none": {{Slot|Raw Porkchop; Cooked Porkchop|title=none}}

shows

Invicon Raw Porkchop.png: Inventory sprite for Raw Porkchop in Minecraft as shown in-game linking to Raw Porkchop (Vanilla) with description:Invicon Cooked Porkchop.png: Inventory sprite for Cooked Porkchop in Minecraft as shown in-game linking to Cooked Porkchop (Vanilla) with description:


However, the first bracketed text can be used to specify a title for each frame individually, and also supports standard formatting codes using & instead of §. If the title only contains formatting codes and no actual text, the formatting will be added to the normal title.

{{Slot|[&b]Diamond Sword}}

shows

Invicon Diamond Sword.png: Inventory sprite for Diamond Sword in Minecraft as shown in-game linking to Diamond Sword (Vanilla) with description: When in main hand:  1.6 Attack Speed  7 Attack Damage


The last bracketed text can be used to specify a description, this also supports standard formatting codes, and can also have multiple lines by using forward slashes (/).

{{Slot|[&b&oExcalibur]Iron Sword[&7Smite V/Fire Aspect I//&9+6 Attack Damage]}}

shows

Invicon Iron Sword.png: Inventory sprite for Iron Sword in Minecraft as shown in-game linking to Iron Sword (Vanilla) with description: Excalibur Smite V Fire Aspect I +6 Attack Damage

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

Invicon Oak Planks.png: Inventory sprite for Oak Planks in Minecraft as shown in-game linking to Oak Planks (Vanilla) with description: Oak PlanksInvicon Spruce Planks.png: Inventory sprite for Spruce Planks in Minecraft as shown in-game linking to Spruce Planks (Vanilla) with description: Spruce PlanksInvicon Birch Planks.png: Inventory sprite for Birch Planks in Minecraft as shown in-game linking to Birch Planks (Vanilla) with description: Birch PlanksInvicon Jungle Planks.png: Inventory sprite for Jungle Planks in Minecraft as shown in-game linking to Jungle Planks (Vanilla) with description: Jungle PlanksInvicon Acacia Planks.png: Inventory sprite for Acacia Planks in Minecraft as shown in-game linking to Acacia Planks (Vanilla) with description: Acacia PlanksInvicon Dark Oak Planks.png: Inventory sprite for Dark Oak Planks in Minecraft as shown in-game linking to Dark Oak Planks (Vanilla) with description: Dark Oak PlanksInvicon Mangrove Planks.png: Inventory sprite for Mangrove Planks in Minecraft as shown in-game linking to Mangrove Planks (Vanilla) with description: Mangrove PlanksInvicon Cherry Planks.png: Inventory sprite for Cherry Planks in Minecraft as shown in-game linking to Cherry Planks (Vanilla) with description: Cherry PlanksInvicon Bamboo Planks.png: Inventory sprite for Bamboo Planks in Minecraft as shown in-game linking to Bamboo Planks (Vanilla) with description: Bamboo PlanksInvicon Crimson Planks.png: Inventory sprite for Crimson Planks in Minecraft as shown in-game linking to Crimson Planks (Vanilla) with description: Crimson PlanksInvicon Warped Planks.png: Inventory sprite for Warped Planks in Minecraft as shown in-game linking to Warped Planks (Vanilla) with description: Warped PlanksInvicon Iron Ingot.png: Inventory sprite for Iron Ingot in Minecraft as shown in-game linking to Iron Ingot (Vanilla) with description: Iron Ingot

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

Smells like Invicon Raw Porkchop.png: Inventory sprite for Raw Porkchop in Minecraft as shown in-game linking to Raw Porkchop (Vanilla) with description: Raw Porkchop in here!

Default

Default is always shown and is placed under the image. {{Slot|default=Brewing}}{{Slot|Splash Mundane Potion|default=Brewing}}

shows

Invicon Splash Mundane Potion.png: Inventory sprite for Splash Mundane Potion in Minecraft as shown in-game linking to Splash Mundane Potion (Vanilla) with description: Splash Mundane Potion

Link

To change the link for all frames from the image name put: {{Slot|Charcoal|link=Coal#Charcoal}}

shows

Invicon Charcoal.png: Inventory sprite for Charcoal in Minecraft as shown in-game linking to Coal#Charcoal with description: Charcoal


To remove the link, set link to none: {{Slot|Charcoal|link=none}}

shows

Invicon Charcoal.png: Inventory sprite for Charcoal in Minecraft as shown in-game with description: Charcoal

Note that this retains the title.

Available images

In general, an item can be referred to by its tooltip name.

For dyes, dyed items and wood, there are two shortcuts to refer to all colors or tree species. Use e.g. "Any Wood Planks" if the item appears in more than one input slot and doesn't have to be the same color in all slots. Different copies of the same "Any [item]" will switch randomly and separately among the variants. Otherwise, use "Matching [item]"; all slots containing a "Matching" item will cycle through the species or dye colors in unison, even if they're not the same item.

{{Slot|Any Planks}}{{Slot|Any wood Slab}}{{Slot|Any wood Stairs}}

{{Slot|Matching Wood Planks}}{{Slot|Matching Wood Slab}}{{Slot|Matching wood Stairs}}

shows

Invicon Oak Planks.png: Inventory sprite for Oak Planks in Minecraft as shown in-game linking to Oak Planks (Vanilla) with description: Oak PlanksInvicon Spruce Planks.png: Inventory sprite for Spruce Planks in Minecraft as shown in-game linking to Spruce Planks (Vanilla) with description: Spruce PlanksInvicon Birch Planks.png: Inventory sprite for Birch Planks in Minecraft as shown in-game linking to Birch Planks (Vanilla) with description: Birch PlanksInvicon Jungle Planks.png: Inventory sprite for Jungle Planks in Minecraft as shown in-game linking to Jungle Planks (Vanilla) with description: Jungle PlanksInvicon Acacia Planks.png: Inventory sprite for Acacia Planks in Minecraft as shown in-game linking to Acacia Planks (Vanilla) with description: Acacia PlanksInvicon Dark Oak Planks.png: Inventory sprite for Dark Oak Planks in Minecraft as shown in-game linking to Dark Oak Planks (Vanilla) with description: Dark Oak PlanksInvicon Mangrove Planks.png: Inventory sprite for Mangrove Planks in Minecraft as shown in-game linking to Mangrove Planks (Vanilla) with description: Mangrove PlanksInvicon Cherry Planks.png: Inventory sprite for Cherry Planks in Minecraft as shown in-game linking to Cherry Planks (Vanilla) with description: Cherry PlanksInvicon Bamboo Planks.png: Inventory sprite for Bamboo Planks in Minecraft as shown in-game linking to Bamboo Planks (Vanilla) with description: Bamboo PlanksInvicon Crimson Planks.png: Inventory sprite for Crimson Planks in Minecraft as shown in-game linking to Crimson Planks (Vanilla) with description: Crimson PlanksInvicon Warped Planks.png: Inventory sprite for Warped Planks in Minecraft as shown in-game linking to Warped Planks (Vanilla) with description: Warped PlanksInvicon Oak Slab.png: Inventory sprite for Oak Slab in Minecraft as shown in-game linking to Oak Slab (Vanilla) with description: Oak SlabInvicon Spruce Slab.png: Inventory sprite for Spruce Slab in Minecraft as shown in-game linking to Spruce Slab (Vanilla) with description: Spruce SlabInvicon Birch Slab.png: Inventory sprite for Birch Slab in Minecraft as shown in-game linking to Birch Slab (Vanilla) with description: Birch SlabInvicon Jungle Slab.png: Inventory sprite for Jungle Slab in Minecraft as shown in-game linking to Jungle Slab (Vanilla) with description: Jungle SlabInvicon Acacia Slab.png: Inventory sprite for Acacia Slab in Minecraft as shown in-game linking to Acacia Slab (Vanilla) with description: Acacia SlabInvicon Dark Oak Slab.png: Inventory sprite for Dark Oak Slab in Minecraft as shown in-game linking to Dark Oak Slab (Vanilla) with description: Dark Oak SlabInvicon Mangrove Slab.png: Inventory sprite for Mangrove Slab in Minecraft as shown in-game linking to Mangrove Slab (Vanilla) with description: Mangrove SlabInvicon Cherry Slab.png: Inventory sprite for Cherry Slab in Minecraft as shown in-game linking to Cherry Slab (Vanilla) with description: Cherry SlabInvicon Bamboo Slab.png: Inventory sprite for Bamboo Slab in Minecraft as shown in-game linking to Bamboo Slab (Vanilla) with description: Bamboo SlabInvicon Crimson Slab.png: Inventory sprite for Crimson Slab in Minecraft as shown in-game linking to Crimson Slab (Vanilla) with description: Crimson SlabInvicon Warped Slab.png: Inventory sprite for Warped Slab in Minecraft as shown in-game linking to Warped Slab (Vanilla) with description: Warped SlabInvicon Oak Stairs.png: Inventory sprite for Oak Stairs in Minecraft as shown in-game linking to Oak Stairs (Vanilla) with description: Oak StairsInvicon Spruce Stairs.png: Inventory sprite for Spruce Stairs in Minecraft as shown in-game linking to Spruce Stairs (Vanilla) with description: Spruce StairsInvicon Birch Stairs.png: Inventory sprite for Birch Stairs in Minecraft as shown in-game linking to Birch Stairs (Vanilla) with description: Birch StairsInvicon Jungle Stairs.png: Inventory sprite for Jungle Stairs in Minecraft as shown in-game linking to Jungle Stairs (Vanilla) with description: Jungle StairsInvicon Acacia Stairs.png: Inventory sprite for Acacia Stairs in Minecraft as shown in-game linking to Acacia Stairs (Vanilla) with description: Acacia StairsInvicon Dark Oak Stairs.png: Inventory sprite for Dark Oak Stairs in Minecraft as shown in-game linking to Dark Oak Stairs (Vanilla) with description: Dark Oak StairsInvicon Mangrove Stairs.png: Inventory sprite for Mangrove Stairs in Minecraft as shown in-game linking to Mangrove Stairs (Vanilla) with description: Mangrove StairsInvicon Cherry Stairs.png: Inventory sprite for Cherry Stairs in Minecraft as shown in-game linking to Cherry Stairs (Vanilla) with description: Cherry StairsInvicon Bamboo Stairs.png: Inventory sprite for Bamboo Stairs in Minecraft as shown in-game linking to Bamboo Stairs (Vanilla) with description: Bamboo StairsInvicon Crimson Stairs.png: Inventory sprite for Crimson Stairs in Minecraft as shown in-game linking to Crimson Stairs (Vanilla) with description: Crimson StairsInvicon Warped Stairs.png: Inventory sprite for Warped Stairs in Minecraft as shown in-game linking to Warped Stairs (Vanilla) with description: Warped Stairs

Invicon Oak Planks.png: Inventory sprite for Oak Planks in Minecraft as shown in-game linking to Oak Planks (Vanilla) with description: Oak PlanksInvicon Spruce Planks.png: Inventory sprite for Spruce Planks in Minecraft as shown in-game linking to Spruce Planks (Vanilla) with description: Spruce PlanksInvicon Birch Planks.png: Inventory sprite for Birch Planks in Minecraft as shown in-game linking to Birch Planks (Vanilla) with description: Birch PlanksInvicon Jungle Planks.png: Inventory sprite for Jungle Planks in Minecraft as shown in-game linking to Jungle Planks (Vanilla) with description: Jungle PlanksInvicon Acacia Planks.png: Inventory sprite for Acacia Planks in Minecraft as shown in-game linking to Acacia Planks (Vanilla) with description: Acacia PlanksInvicon Dark Oak Planks.png: Inventory sprite for Dark Oak Planks in Minecraft as shown in-game linking to Dark Oak Planks (Vanilla) with description: Dark Oak PlanksInvicon Mangrove Planks.png: Inventory sprite for Mangrove Planks in Minecraft as shown in-game linking to Mangrove Planks (Vanilla) with description: Mangrove PlanksInvicon Cherry Planks.png: Inventory sprite for Cherry Planks in Minecraft as shown in-game linking to Cherry Planks (Vanilla) with description: Cherry PlanksInvicon Bamboo Planks.png: Inventory sprite for Bamboo Planks in Minecraft as shown in-game linking to Bamboo Planks (Vanilla) with description: Bamboo PlanksInvicon Oak Slab.png: Inventory sprite for Oak Slab in Minecraft as shown in-game linking to Oak Slab (Vanilla) with description: Oak SlabInvicon Spruce Slab.png: Inventory sprite for Spruce Slab in Minecraft as shown in-game linking to Spruce Slab (Vanilla) with description: Spruce SlabInvicon Birch Slab.png: Inventory sprite for Birch Slab in Minecraft as shown in-game linking to Birch Slab (Vanilla) with description: Birch SlabInvicon Jungle Slab.png: Inventory sprite for Jungle Slab in Minecraft as shown in-game linking to Jungle Slab (Vanilla) with description: Jungle SlabInvicon Acacia Slab.png: Inventory sprite for Acacia Slab in Minecraft as shown in-game linking to Acacia Slab (Vanilla) with description: Acacia SlabInvicon Dark Oak Slab.png: Inventory sprite for Dark Oak Slab in Minecraft as shown in-game linking to Dark Oak Slab (Vanilla) with description: Dark Oak SlabInvicon Mangrove Slab.png: Inventory sprite for Mangrove Slab in Minecraft as shown in-game linking to Mangrove Slab (Vanilla) with description: Mangrove SlabInvicon Cherry Slab.png: Inventory sprite for Cherry Slab in Minecraft as shown in-game linking to Cherry Slab (Vanilla) with description: Cherry SlabInvicon Bamboo Slab.png: Inventory sprite for Bamboo Slab in Minecraft as shown in-game linking to Bamboo Slab (Vanilla) with description: Bamboo SlabInvicon Oak Stairs.png: Inventory sprite for Oak Stairs in Minecraft as shown in-game linking to Oak Stairs (Vanilla) with description: Oak StairsInvicon Spruce Stairs.png: Inventory sprite for Spruce Stairs in Minecraft as shown in-game linking to Spruce Stairs (Vanilla) with description: Spruce StairsInvicon Birch Stairs.png: Inventory sprite for Birch Stairs in Minecraft as shown in-game linking to Birch Stairs (Vanilla) with description: Birch StairsInvicon Jungle Stairs.png: Inventory sprite for Jungle Stairs in Minecraft as shown in-game linking to Jungle Stairs (Vanilla) with description: Jungle StairsInvicon Acacia Stairs.png: Inventory sprite for Acacia Stairs in Minecraft as shown in-game linking to Acacia Stairs (Vanilla) with description: Acacia StairsInvicon Dark Oak Stairs.png: Inventory sprite for Dark Oak Stairs in Minecraft as shown in-game linking to Dark Oak Stairs (Vanilla) with description: Dark Oak StairsInvicon Mangrove Stairs.png: Inventory sprite for Mangrove Stairs in Minecraft as shown in-game linking to Mangrove Stairs (Vanilla) with description: Mangrove StairsInvicon Cherry Stairs.png: Inventory sprite for Cherry Stairs in Minecraft as shown in-game linking to Cherry Stairs (Vanilla) with description: Cherry StairsInvicon Bamboo Stairs.png: Inventory sprite for Bamboo Stairs in Minecraft as shown in-game linking to Bamboo Stairs (Vanilla) with description: Bamboo StairsInvicon Crimson Stairs.png: Inventory sprite for Crimson Stairs in Minecraft as shown in-game linking to Crimson Stairs (Vanilla) with description: Crimson StairsInvicon Warped Stairs.png: Inventory sprite for Warped Stairs in Minecraft as shown in-game linking to Warped Stairs (Vanilla) with description: Warped Stairs

Most items with a durability bar exist as "Damaged [item]".

See Template:InvSprite for the full list of items.

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.


de: Inventar slot/Dokumentation es:Plantilla:Inventory slot/doc fr:Modèle:Case inventaire/doc ja:テンプレート:Inventory slot/doc pt:Predefinição:Compartimento de inventário/doc ru:Шаблон:Инвентарный слот/док uk:Шаблон:Інвентарний слот/док