One Studios

How to add items to ox_inventory (2026 guide)

Add items to ox_inventory the right way: the data/items.lua format, every field, images, usable items with exports, AddItem, plus ESX and QBox notes.
One Studios Team··8 min read

Short answer

Add a table to ox_inventory/data/items.lua keyed by the item's lowercase name, with at least a label and a weight in grams (plus optional stack, close, description, client and server options). Drop a PNG with the same name into ox_inventory/web/images and restart ox_inventory. Give it in-game with /additem or from a server script with exports.ox_inventory:AddItem(source, 'itemname', count).

To add an item to ox_inventory, add an entry to ox_inventory/data/items.lua keyed by the item's name in lowercase, give it at least a label and a weight in grams, put a PNG with the same name in ox_inventory/web/images/, and restart ox_inventory. Then hand it out with /additem in-game or exports.ox_inventory:AddItem(source, 'itemname', 1) from a server script. Everything below is checked against ox_inventory v2.48.1 (October 2026), the current release.

We've written a lot of ox items over the years, and we read a lot more of them when we built the migration wizard for One Inventory, which imports items.lua files. So this guide covers the format, the fields people get wrong, usable items, and the mistakes we see most. If you'd rather skip the Lua, the last section shows the same thing done in an admin panel.

Adding an item in four steps

  1. Open ox_inventory/data/items.lua. It's one big Lua table that starts with return { and ends with }.
  2. Add your item inside that table, next to the existing ones:
['energy_drink'] = {
    label = 'Energy Drink',
    weight = 330,
    description = 'Tastes like a battery. Works, though.',
    client = {
        status = { thirst = 150000 },
        anim = { dict = 'mp_player_intdrink', clip = 'loop_bottle' },
        prop = { model = `prop_ld_can_01`, pos = vec3(0.01, 0.01, 0.06), rot = vec3(5.0, 5.0, -180.5) },
        usetime = 2500,
        notification = 'You feel wired',
    },
},
  1. Save a PNG called energy_drink.png into ox_inventory/web/images/. By default ox loads <item name>.png from that folder, and its own icons are 100 x 100 pixels.
  2. Restart ox_inventory (or the whole server), then test with /additem 1 energy_drink 2 from an admin account.

That's a working, usable drink: the progress bar plays the drinking animation with a can in hand, thirst goes up, and one is removed from the stack. The animation and prop values are copied from ox's own sprunk item, so you know the can sits in the hand properly.

Every field in data/items.lua

The official Creating Items guide lists the options. Here they are with the defaults the code actually applies (from modules/items/shared.lua):

FieldTypeWhat it does
labelstringDisplay name.
weightnumberWeight in grams. Defaults to 0.
stackbooleanDefaults to true. Set false for unique items like phones or IDs.
closebooleanDefaults to true (closes the inventory on use). Set false to keep it open.
descriptionstringTooltip text.
consumenumberHow many are removed per use. Defaults to 1 when the item has a status, usetime or export. A decimal like 0.2 drains 20% durability per use instead. 0 means it's never consumed.
degradenumberMinutes until the item's durability runs out.
decaybooleanDelete the item when durability hits 0.
allowArmedbooleanAllow using it while holding a weapon.
clienttableClient-side use options (see below).
servertableexport = 'resource.exportName' to run server code on use.
buttonstableExtra right-click entries: { label = '...', action = function(slot) end }.

And inside client:

FieldWhat it does
statusAdds to esx_status or QBox statuses, for example { hunger = 200000 }.
anim{ dict = '...', clip = '...' } played during the progress bar, or a preset name from data/animations.lua such as 'eating'.
prop{ model = ..., pos = vec3(...), rot = vec3(...) } held during the progress bar, or a preset name such as 'burger'.
disable{ move, car, combat, mouse, sprint } to block actions while using. Combat is blocked by default.
usetimeProgress bar length in milliseconds.
cancelLets the player cancel the progress bar.
notificationText shown after a successful use.
imageA different image file ('card_bank.png') or a full URL.
export / eventA client export ('resource.exportName') or client event triggered on use.
add / removeFunctions called with the new total when the player gains or loses the item.

One heads-up: the burger example on the official docs page has a small typo (it sets y twice inside pos). The items in ox's own data/items.lua use vec3(...) and make a better template.

Making an item usable

Status, animation and usetime cover food, drinks and bandage-style items. Anything with custom logic needs one of three routes.

A client export

Set client = { export = 'my_items.energy_drink' } and define the export in your own resource. The callback receives the item data and the slot. Inside it, call exports.ox_inventory:useItem: that's what runs the server check, the progress bar and the consume. Skip it and your effect runs, but the item is never removed.

-- my_items/client.lua
exports('energy_drink', function(data, slot)
    exports.ox_inventory:useItem(data, function(used)
        if not used then return end -- server refused, or the player cancelled

        SetRunSprintMultiplierForPlayer(PlayerId(), 1.2)

        SetTimeout(30000, function()
            SetRunSprintMultiplierForPlayer(PlayerId(), 1.0)
        end)
    end)
end)

A server export

server = { export = 'my_items.energy_drink' } calls your server export with (event, item, inventory, slot, data). The event is 'usingItem' before the use (return false to cancel it), 'usedItem' after it went through, and 'buying' when someone buys the item in a shop. That signature comes from ox's metadata guide and its official examples resource.

-- my_items/server.lua
local lastUse = {}

exports('energy_drink', function(event, item, inventory, slot, data)
    if event == 'usingItem' then
        -- inventory.id is the player's server id for player inventories
        local last = lastUse[inventory.id]

        if last and os.time() - last < 60 then
            return false -- one per minute, nothing is consumed
        end
    elseif event == 'usedItem' then
        lastUse[inventory.id] = os.time()
    end
end)

You can give one item both a client and a server export.

ESX and QBox usable item callbacks

If your scripts already use ESX.RegisterUsableItem or exports.qbx_core:CreateUseableItem, those keep working: ox hands the use over to the framework. The catch, straight from ox's server.lua: it only does that when the item has no consume value and no client.status, client.usetime, client.export or server.export. Give a framework-usable item a usetime "just to get a progress bar" and ox treats it as its own item, so your ESX callback silently stops firing. Pick one system per item.

Giving the item to players

In-game, ox registers /additem <playerId> <item> [count] [type] (alias /giveitem), restricted to group.admin. The optional last argument sets the item's type metadata.

From a server script, use the AddItem export. The full signature is AddItem(inv, item, count, metadata, slot, cb), where inv can be a player's server id, a stash id or a vehicle inventory id like 'gloveABC123'. The docs recommend checking CanCarryItem first, otherwise the player can go over their weight limit:

local ox_inventory = exports.ox_inventory

local function giveEnergyDrink(source, count)
    if not ox_inventory:CanCarryItem(source, 'energy_drink', count) then
        return false, 'cannot_carry'
    end

    -- returns success, response ('invalid_item', 'invalid_inventory', 'inventory_full' on failure)
    return ox_inventory:AddItem(source, 'energy_drink', count, {
        label = 'Sugar-free Energy Drink',
        description = 'Zero sugar, same regret.',
    })
end

label, description, weight, image and imageurl are special metadata keys, so the example above gives one stack its own name and tooltip without defining a second item. Any other keys you add are stored on the item and readable from your scripts.

ESX and QBox notes

ESX Legacy (1.6.0 or newer). Current es_extended detects ox_inventory and sets Config.CustomInventory = "ox" by itself. One thing people don't expect: on start, ox reads the ESX items SQL table and appends any item that isn't in data/items.lua yet to the file, then tells you to restart. So an item added by an old ESX script's SQL file does end up in ox, but with only label, weight, stack, close and description. Use options like animations still need adding by hand. Status values use the esx_status scale, where 1,000,000 is a full bar, so hunger = 200000 fills a fifth.

QBox. Items go in ox_inventory/data/items.lua, full stop. The Qbox FAQ says so, and qbx_core's shared/items.lua is marked deprecated. qbx_core builds QBCore.Shared.Items from ox's item list for bridge scripts. Moving a QBCore item list over? Paste it into that deprecated file and run convertqbitems in the server console: qbx writes the missing items to qbx_core/converted.lua for you to copy into ox. ox converts ESX-style status values on QBox (anything above 100 is multiplied by 0.0001), so thirst = 200000 adds 20.

QBCore. Current ox_inventory doesn't support it. The QBCore bridge was removed in v2.42.0 (August 2024).

Common mistakes we see

  • Uppercase item names. ox lowercases every item name it looks up (weapons are the exception, those get uppercased). An item keyed ['Energy_Drink'] sits in the table, but AddItem(source, 'Energy_Drink') searches for energy_drink and returns invalid_item. Keep keys lowercase.
  • One missing comma. A single missing , between two entries and the whole file fails to load, taking every item with it. The console error names the line. Read it.
  • No restart. items.lua is read on start. Saving the file does nothing until ox_inventory restarts.
  • A client export that never calls useItem. The effect runs, the item stays. Congratulations, you've invented infinite energy drinks.
  • Mixing systems on one item. Framework callbacks plus ox use options means the framework callback never runs (see above).
  • The wrong image name or format. Energy_Drink.png or energy_drink.webp won't show. ox requests energy_drink.png, and its fxmanifest only sends web/images/*.png to clients.
  • Using it with a gun out. Regular items are blocked while a weapon is equipped unless they have allowArmed = true.

Honestly, editing items.lua on a live server at 3 AM is how most of these happen. Make the change on a test server, restart, test, then copy the file over.

From the team behind this blog

One Inventory: configure your whole inventory in-game

Items, weapons, shops, stashes, crafting, vehicle storage and the config itself, all edited live from an admin panel. Works on ESX, QBCore and QBox, and migrates your ox_inventory or qb-inventory data in one flow.

The same item without touching Lua

Full disclosure: One Inventory is our product, so weigh this section accordingly. It's also the reason we know ox's format this well.

One Inventory has no items.lua. You open /inventory:manage, go to Items and create the item: name, label, weight, stack size, rarity, the use animation and prop, hunger and thirst effects and how many are consumed. For the image you paste a picture straight into the image picker with Ctrl+V and it's live for everyone. Hit save and every connected player has the item immediately, without a restart. Need five flavours of energy drink? Duplicate the item and change the name.

Custom logic works like ox's exports: you write the export in your own resource and type my_items.energy_drink into the item's server or client export field in the panel. The server export receives (source, itemName, slot, metadata) and returning false cancels the use. To be straight with you, ox-style (event, item, inventory, slot, data) callbacks are not compatible, so you rewrite those, which is about five lines each. The usable items guide has both signatures. ESX.RegisterUsableItem and CreateUseableItem keep working, and unlike in ox, they still fire when the item also has animations or effects set in the panel.

Giving items doesn't change much either. One Inventory answers as ox_inventory, so the exports.ox_inventory:AddItem(...) calls in your existing scripts keep working (the backwards compatibility page lists every export). New code can call exports.one_inventory:AddItem directly. And if you already have a few hundred items in items.lua, you don't retype them: the migration wizard imports ox's items, weapons, shops and stashes, plus player inventories, without touching ox's tables.

Our take

items.lua is a good format. It's readable, it's in version control, and once you know the gotchas above you can add an item in two minutes. If you're a developer running ox on ESX or QBox, keep doing it that way and use this page as your reference.

Where it falls apart is when the person adding items isn't a developer, or when every small change means a restart on a live server. That's the gap we built One Inventory for. If you want a broader look at your options first, our roundup of the best FiveM inventory scripts and the One Inventory vs ox_inventory comparison lay it out.

Frequently asked questions

From the team behind this blog

One Inventory: configure your whole inventory in-game

Items, weapons, shops, stashes, crafting, vehicle storage and the config itself, all edited live from an admin panel. Works on ESX, QBCore and QBox, and migrates your ox_inventory or qb-inventory data in one flow.

Keep reading