Template:ItemNameFromId/doc

来自Terraria Wiki
跳到导航 跳到搜索

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