Template:ItemNameFromId

From Terraria Wiki
Jump to navigation Jump to search
This template uses Lua.
This template uses Module:ItemNames, a script written in the Lua programming language. To learn more about Lua, see Terraria Wiki:Lua.
Template-info.svg Documentation The documentation below is transcluded from Template:ItemNameFromId/doc. (edit | history)

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