GetItemInfo

From Wowpedia
Jump to: navigation, search

Returns information about an item.

itemName, itemLink, itemQuality, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount,
itemEquipLoc, itemTexture, sellPrice, classID, subclassID, bindType, expacID, setID, isCraftingReagent
   = GetItemInfo(itemInfo) 

Arguments

itemInfo 
string : ItemLink, Name or ID

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 and 3 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, or "" 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 - The Item Set ID, e.g. 761 for  [Red Winter Hat].
17. isCraftingReagent 
boolean - Whether the item can be used as a crafting reagent.

Example

/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
  • Some item data may not have been cached from the server yet. You can use ItemMixin:ContinueOnItemLoad() to asynchronously query the data.
    Prints the name and icon FileID for an item.
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

See also

External links