Template:ItemIdFromName

来自Terraria Wiki
跳转到导航 跳转到搜索
此模板使用了 Lua。
此模板使用了用 Lua 编程语言编写的 模块:ItemNames。要了解 Lua 的更多信息,参见 en:Terraria Wiki:Lua
Important.svg
CAUTION: Terraria Wiki code is complex!!!
If you want to use this code on another wiki, wiki.gg staff are not able to assist you.
Please consider picking a different wiki to adapt code from, or making your own templates!
Remember that content on a wiki is more important than fancy formatting.
Template-info.svg 文档 以下文档来自Template:ItemIdFromName/doc。(编辑 | 历史

This template returns the item ID of an item based on its English name. It requires the exact name of the item, as presented at Item IDs. Notably, wiki aliases like "Blue Jellyfish (bait)" are not recognized.

Usage

{{ itemIdFromName | <item name> }}

First unnamed parameter

English name of the item. If empty or invalid, the template will return an empty string.

Examples

Code Result
{{itemIdFromName|Iron Pickaxe}} 1
{{itemIdFromName|S.D.M.G.}} 1553
{{itemIdFromName| S.D.M.G. }} 1553
{{itemIdFromName|}}
{{itemIdFromName}}
{{itemIdFromName|ThisItemNameDoesn'tExist}}
{{itemIdFromName|Blue Jellyfish (bait)}}
{{itemIdFromName|Blue Jellyfish}} 2436

Notes

See also