Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API GetItemFamily

Last wiki revision 2022-07-22

Returns the bag type that an item can go into, or for bags the type of items that it can contain.

bagType = GetItemFamily(itemId or itemName or itemLink)

  • (itemId or "itemName" or "itemLink")
  • itemId: - The numeric ID of the item. ie. 12345
  • itemName: - The Name of the Item, ex: "Hearthstone"
  • itemLink: - The itemLink, when Shift-Clicking items.
  • bagType:Bitfield - What type of bags an item can go into or if the item is a container what it can contain

local a = GetItemFamily(22786)

Result a = 32

  • New function for 2.4 that allows you to find out what items can go into what bags. If the item you pass is a container itself it will return what items it can contain since containers can always only go in general purpose bags. This function only returns info for the items in the item cache just like GetItemInfo. If the item is not in the item cache the function will return nil.
  • The best way of testing if an item is a bag (or quiver) is to GetItemInfo it and check if the 9th return value is "INVTYPE_BAG". All other tests require localization.

Source

https://warcraft.wiki.gg/wiki/API_GetItemFamily · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.