Returns information about special bag types that can hold a given item. The meaning of bagType
varies depending on the item:
- If the item is a container,
bagType
indicates which kinds of items the container is limited to holding; abagType
of 0 indicates the container can hold any kind of item. - If the item is not a container,
bagType
indicates which kinds of specialty containers can hold the item; abagType
of 0 indicates the item can only be put in general-purpose containers.
See also Item functions, Container functions.
Signature:
bagType
=
GetItemFamily(itemID)
or
GetItemFamily("itemName")
or
GetItemFamily("itemLink")
Arguments:
itemID
- An item's ID (number
)itemName
- An item's name (string
)itemLink
- An item's hyperlink, or any string containing theitemString
portion of an item link (string
)
Returns:
bagType
- Bitwise OR of bag type flags: (number
, bitfield)0x0001
- Quiver0x0002
- Ammo Pouch0x0004
- Soul Bag0x0008
- Leatherworking Bag0x0010
- Inscription Bag0x0020
- Herb Bag0x0040
- Enchanting Bag0x0080
- Engineering Bag0x0100
- Keyring0x0200
- Gem Bag0x0400
- Mining Bag0x0800
- Unused0x1000
- Vanity Pets0x2000
- Unused0x4000
- Unused0x8000
- Tackle Box0x10000
- Cooking Bag
Examples:
function CanGoInBag(item, bag) -- Get the item's family local itemFamily = GetItemFamily(item) -- If the item is a container, then the itemFamily should be 0 local equipSlot = select(9, GetItemInfo(item)) if equipSlot == "INVTYPE_BAG" then itemFamily = 0 end -- Get the bag's family local bagFamily = select(2, GetContainerNumFreeSlots(bag)) return bagFamily == 0 or bit.band(itemFamily, bagFamily) > 0 end