API types < Unit:GetInventoryItems

Returns a list of the player's inventory items. Calling this on anyone but the current player returns an empty table.

local items = unit:GetInventoryItems()

Return Values Edit

  • table - An array containing a player's items and the corresponding bag slot that they are found in.

Examples Edit

function printItemNames()
    local player = GameLib.GetPlayerUnit()
    local items = player:GetInventoryItems()
    for key, value in pairs(items) do
        local item = value["itemInBag"]

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.