Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
Returns item info.
itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, sellPrice, classID, subclassID, bindType, expacID, setID, isCraftingReagent = GetItemInfo(itemInfo)
Arguments
- itemInfo
- string : Item ID, Link or Name
- When passing only a name this requires the item to be in your inventory.
Returns
- 1. itemName
- string - The localized name of the item.
- 2. itemLink
- string : ItemLink - The localized link of the item.
- 3. itemQuality
- number : Enum.ItemQuality - The quality of the item, e.g.
2
for Uncommon and3
for Rare quality items. - 4. itemLevel
- number - The base item level, not including upgrades. See GetDetailedItemLevelInfo() for getting the actual item level.
- 5. itemMinLevel
- number - The minimum level required to use the item, or
0
if there is no level requirement. - 6. itemType
- string : ItemType - The localized type name of the item: Armor, Weapon, Quest, etc.
- 7. itemSubType
- string : ItemType - The localized sub-type name of the item: Bows, Guns, Staves, etc.
- 8. itemStackCount
- number - The max amount of an item per stack, e.g. 200 for Runecloth.
- 9. itemEquipLoc
- string : Enum.InventoryType - The inventory equipment location in which the item may be equipped e.g.
"INVTYPE_HEAD"
, or an empty string if it cannot be equipped. - 10. itemTexture
- number : FileID - The texture for the item icon.
- 11. sellPrice
- number - The vendor price in copper, or
0
for items that cannot be sold. - 12. classID
- number : ItemType - The numeric ID of
itemType
- 13. subclassID
- number : ItemType - The numeric ID of
itemSubType
- 14. bindType
- number : LE_ITEM_BIND - When the item becomes soulbound, e.g.
1
for Bind on Pickup items. - 15. expacID
- number : LE_EXPANSION - The related Expansion, e.g.
8
for Shadowlands. - 16. setID
- number : ItemSetID - For example 761 for [Red Winter Hat].
- 17. isCraftingReagent
- boolean - Whether the item can be used as a crafting reagent.
Example
- Prints item information for [Silk Cloth]
/dump GetItemInfo(4306)
[1] = "Silk Cloth", -- itemName
[2] = "|cffffffff|Hitem:4306::::::::53:258:::::::|h[Silk Cloth]|h|r", -- itemLink
[3] = 1, -- itemQuality: Enum.ItemQuality.Common
[4] = 13, -- itemLevel
[5] = 0, -- itemMinLevel
[6] = "Tradeskill", -- itemType
[7] = "Cloth", -- itemSubType
[8] = 200, -- itemStackCount
[9] = "", -- itemEquipLoc
[10] = 132905, -- itemTexture
[11] = 150, -- sellPrice
[12] = 7, -- classID: LE_ITEM_CLASS_TRADEGOODS
[13] = 5, -- subclassID
[14] = 0, -- bindType: LE_ITEM_BIND_NONE
[15] = 0, -- expacID: LE_EXPANSION_CLASSIC
[16] = nil, -- setID
[17] = true -- isCraftingReagent
- Item information may not have been cached. You can use ItemMixin:ContinueOnItemLoad() to asynchronously query the data.
local item = Item:CreateFromItemID(21524)
item:ContinueOnItemLoad(function()
local name = item:GetItemName()
local icon = item:GetItemIcon()
print(name, icon) -- "Red Winter Hat", 133169
end)
Patch changes
- Patch 7.1.0 (2016-10-25): Added bindType, expacID, itemSetID, and isCraftingReagent.
- Patch 7.0.3 (2016-07-19): Item icon is now returned as a FileID rather than a path. Additionally, two new returns were added: itemClassID and itemSubClassID.