Template:ItemNameFromId

来自Terraria Wiki
跳转到导航 跳转到搜索
此模板使用了 Lua。
此模板使用了用 Lua 编程语言编写的 模块:ItemNames。要了解 Lua 的更多信息,参见 en:Terraria Wiki:Lua
Template-info.svg 文档 以下文档来自Template:ItemNameFromId/doc。(编辑 | 历史

This template returns the English name of an item based on its item ID. See below for retrieving the name in a different language.

Usage

{{ itemNameFromId | <item ID> (optional)}}

First unnamed parameter

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

Examples

Code Result
{{ItemNameFromId|1}} Iron Pickaxe
{{ItemNameFromId|1553}} S.D.M.G.
{{ItemNameFromId| 1553 }} S.D.M.G.
{{ItemNameFromId|7000}}
{{ItemNameFromId|}}

Notes

  • To retrieve the name of an item based on its ID in a language other than English, use one of the following methods:
    • Get the internal item name and turn it into the display name via {{gameText}} with the lang parameter.
    {{gameText|ItemName.{{ItemInternalNameFromId|<item ID>}}|lang=<language code>}}
    • Get the English name with this template and translate it via {{tr}}.
    {{tr|{{ItemNameFromId|<item ID>}}|lang=<language code>}}

See also