Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetEquipmentData

From RoR Wiki
Revision as of 19:43, 16 October 2026 by Maintenance script (talk | contribs) (UI Lua API import (WAR 1.4.8))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

UI Lua API · Game functions
Version: WAR 1.4.8

Returns the items the player has equipped, one table per equipment slot.

equipment = GetEquipmentData()

Arguments

None.

Returns

equipment
table – Array of 20 item data tables, indexed by equipment slot from 1 to 20.

Details

  • The table always has 20 entries. An empty slot gets a blank item table (id 0, empty name).
  • If there is no player object, or the Lua state is not available, the function returns nothing.
  • A new table is built on every call. The stock UI caches it in DataUtils.GetEquipmentData() (easystem_utils/source/datautils.lua) and rebuilds it only when GameData.Player.equippedItemsDirty is set.

Errors

None.

Example

From easystem_utils/source/datautils.lua:

function DataUtils.GetEquipmentData ()
    if (GameData.Player.equippedItemsDirty)
    then
        GameData.Player.equippedItemsDirty = false
        DataUtilsData.equippedItems = GetEquipmentData()
    end

    return DataUtilsData.equippedItems
end

Comparing with the currently equipped item, from easystem_tooltips/source/itemtooltips.lua:

local curItem = DataUtils.GetEquipmentData()[playerEquipSlot];

See also