<本站文本内容除另有声明外,转载时均必须注明出处。(详情…本站文本内容除另有声明外,转载时均必须注明出处。(详情…中文Minecraft Wiki是完全公开的。请勇于扩充与修正内容!中文Minecraft Wiki是完全公开的。请勇于扩充与修正内容!Minecraft中文Wiki微博正在更新!或许有兴趣去看看Minecraft中文Wiki微博正在更新!或许有兴趣去看看想与其他用户进行编辑上的沟通?社区专页正是为此创建的。想与其他用户进行编辑上的沟通?社区专页正是为此创建的。翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。需要管理员的协助?在管理员告示板留言也许可以帮到您。需要管理员的协助?在管理员告示板留言也许可以帮到您。>

模板:Inventory slot

出自Minecraft Wiki
前往: 導覽搜尋


[查看 | 編輯 | 歷史 | 清除緩存]文檔頁面
快捷方式
Slot
Lua logo.svg
此模板使用了模塊:Inventory slot,以及數據模塊模塊:Inventory slot/Aliases
這些腳本均使用Lua編寫。更多詳情,請參閱維基百科:LuaMediaWiki:擴展:Scribunto

Inventory slot模板用於創建模仿遊戲內物品欄的圖形介面元素。圖像主要取自{{InvSprite}},若指定項目未被找到,模板會回落至獨立圖像,名稱格式為Grid <物品名>.png

用法[編輯原始碼]

所有的輸入都是可選的:

{{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
}}

部分[編輯原始碼]

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.

示例[編輯原始碼]

To display an inventory item of "Raw Porkchop" with an stack size of 20 you would put: {{Slot|Raw Porkchop,20}}

顯示


20


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

別稱[編輯原始碼]

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}}

顯示









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}}

顯示


4

4

4

4

4

4
Shiny Apple


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

標題和描述[編輯原始碼]

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

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

顯示




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

顯示




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}}

顯示



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]}}

顯示



子框架[編輯原始碼]

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}}

顯示











對齊[編輯原始碼]

Align uses the vertical-align CSS property. For example to align to the middle: Smells like {{Slot|Raw Porkchop|align=middle}} in here!

顯示

Smells like

in here!

預設[編輯原始碼]

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

顯示




連結[編輯原始碼]

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

顯示



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

顯示



Note that this retains the title.

可用圖像[編輯原始碼]

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 Planks}}{{Slot|Matching wood Slab}}{{Slot|Matching wood Stairs}}

shows













































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

See Template:InvSprite for the full list of items.

其他模板[編輯原始碼]

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.

[查看 | 編輯 | 歷史 | 清除緩存]上述文檔是從Template:Inventory slot/doc引用的。