Skip to content
FIVECRATE
Frameworks beginner

How to Add Items to ox_inventory (Qbox, ESX, QBCore)

How to add items to ox_inventory: define them in data/items.lua, add PNG images, make them usable, and what changes on Qbox, ESX and QBCore servers.

Player in tactical gear holding a tablet that shows inventory item icons, a city at night behind
Author: FiveCrate
Published:
Updated:
Read time: 19 min
Applies to
ox_inventory v2.48.1 (released 2026-10-24) on FiveM Legacy and FiveM for GTAV Enhanced (ox_inventory's docs do not mention Enhanced); Qbox with qbx_core v1.24.1 (2026-10-30); ESX Legacy 1.16.4 (2026-10-18); QBCore (qb-core as of 2026-08-24) with qb-inventory only
Last verified

Direct Answer

To add items to ox_inventory, open ox_inventory/data/items.lua and add an entry inside its return { ... } table, shaped like the stock ['lockpick'] = { label = 'Lockpick', weight = 160 }, but with your own lowercase item name as the key. The key is the name scripts and /giveitem use, label is the name players see, and weight is in grams. Save a PNG named after the key in ox_inventory/web/images. Restart the server, then test in game with /giveitem me, your key and a count. Qbox and ESX both read this file. QBCore is not a supported ox_inventory framework, so plain QBCore keeps its items in qb-core/shared/items.lua.

How ox_inventory items work

ox_inventory keeps one item list for the whole server. Its Creating Items page says an item must be defined before you can see or use it in game, and that every item lives in /data/items.lua as a key and a value: the key is the item’s name, not its label, and the value is a table of options. This guide follows ox_inventory v2.48.1, released on October 24, 2026, as read on November 21, 2026.

The file is one Lua table. It starts with return {, ends with }, and every item is one entry in between. Weapons, ammo and attachments are not in this file: ox_inventory loads them from data/weapons.lua, which the addon weapons guide covers.

Three rules come from the ox_inventory code rather than from the docs page:

  • Use lowercase names. Before it looks an item up, ox_inventory turns the requested name into lowercase, and a name that starts with weapon_ into uppercase. An entry written as ['MyItem'] cannot be found by /giveitem or by a script.
  • Do not rename or delete items that players own. When a player’s inventory loads, ox_inventory keeps only the entries whose name it finds in the item list, and what it loaded is what gets saved later. A stack of a renamed item is not loaded, and the next save writes the inventory without it.
  • Weights are grams. The config docs give the player carry limit, inventory:weight, in grams with a default of 30000. The inventory screen shows a weight below 1000 in grams and a weight of 1000 or more in kilograms, so one item with weight = 220 reads as 220g.

Step by step: add an item to ox_inventory/data/items.lua

  1. Open the file. It is data/items.lua inside the ox_inventory resource folder. A server deployed from the Qbox txAdmin recipe has the resource in resources/[ox]/ox_inventory, and the recipe replaced the stock data/items.lua with Qbox’s own list. Edit the file your server runs.
  2. Add your entry before the final }. Copy the shape of an existing item and give it a key the file does not use yet. These two entries come from the stock file: a usable food item and a plain item. They are shown inside return { } the way the file holds them; paste only the entry, not a second return {.
return {
    ['burger'] = {
        label = 'Burger',
        weight = 220,
        client = {
            status = { hunger = 200000 },
            anim = 'eating',
            prop = 'burger',
            usetime = 2500,
            notification = 'You ate a delicious burger'
        },
    },

    ['lockpick'] = {
        label = 'Lockpick',
        weight = 160,
    },
}
  1. Add the picture. Save a PNG named exactly like the key, such as lockpick.png, in ox_inventory/web/images. The image rules are in the section below.
  2. Restart the server. The item list is read when the resource starts. During startup, ox_inventory prints the message Inventory has loaded <count> items in the console; the count includes the weapons, ammo and attachments from data/weapons.lua.
  3. Give the item to yourself. The /giveitem command, also registered as /additem, takes a player (me means you), the item name, an optional count and an optional type metadata value. It is restricted to group.admin; the admin permissions guide shows how to get that group. The Qbox docs run this check in game after typing /optin in the chat, with /giveitem me water_bottle 1, and the item should then appear with the right name and picture.

The examples on the Creating Items page carry two typos: the second burger has no comma after its description line, and pos and rot list y twice and no z. Copy from data/items.lua instead.

Every field of an ox_inventory item

The docs mark every option except label as optional. The defaults below come from the item loader in modules/items/shared.lua.

FieldTypeWhat it doesDefault
labelstringName shown in the inventoryAlways set it
weightnumberWeight in grams0
stackbooleanfalse gives every item its own slottrue
closebooleanfalse keeps the inventory open when the item is usedtrue
descriptionstringText shown in the tooltipNone
consumenumberCount needed and removed per use; a decimal uses durability instead (0.2 = 20%)1 in the docs; see below
degradenumberMinutes until the item has fully degradedNone
decaybooleantrue deletes the item when durability reaches 0None
allowArmedbooleantrue allows use while holding a weaponNone
buttonstableContext menu buttons, each with a label and an action(slot) functionNone
server.exportstringExport called on the server when the item is usedNone
clienttableClient options, next tableNone

Setting degrade, or a consume value between 0 and 1, turns on durability for the item. In the stock file, testburger uses degrade = 60, and consume = 0.3 takes 30% of its durability per use.

client fieldWhat it does
imageImage file name inside the image folder, or a full URL; replaces the default <name>.png
statusStatus changes after use, such as { hunger = 200000 }; the docs describe them as esx_status values
animAnimation during the progress bar: a table with dict and clip, or a preset name such as 'eating' from data/animations.lua
propProp held during the progress bar: model, pos, rot, optional bone and rotOrder, or a preset name such as 'burger'
disableActions blocked during the progress bar: move, car, combat, mouse, sprint; ox_inventory blocks combat unless you set combat = false
usetimeLength of the progress bar; without it there is no progress bar (the stock food items use 2500)
canceltrue lets the player cancel the use
notificationText shown after a successful use
export, eventExport or event called when the player uses the item, in place of the built-in use; an export hands the use back with useItem (see below)
add, removeFunctions that run when the item is received or removed, with the new total count

Container items: bags and boxes

A container item opens its own small inventory, like the stock paperbag. Register the item in data/items.lua first; the stock paper bag uses stack = false, close = false and consume = 0. Then give it container properties in modules/items/containers.lua or with the setContainerProperties server export, keyed by the item name. You set the number of slots and the maximum weight, plus an optional whitelist or blacklist of item names. This is the stock definition:

setContainerProperties('paperbag', {
    slots = 5,
    maxWeight = 1000,
    blacklist = { 'testburger' }
})

ox_inventory item images: folder, file name and format

When an item has no image of its own, the inventory screen requests <image path>/<item name>.png. The image path is the inventory:imagepath convar, which the docs describe as “The URL to load item images from”. Its default is nui://ox_inventory/web/images, the web/images folder of the resource.

  • File name: the item key plus .png. A lockpick entry looks for lockpick.png.
  • Format: PNG. The resource manifest lists web/images/*.png as the image files sent to players.
  • A different file: set client.image to the file name with its extension. The stock testburger uses image = 'burger_chicken.png' and identification uses image = 'card_id.png'. A value that starts with a scheme such as https:// is used as a full URL; any other value is read from the image path.
  • One item, many pictures: item metadata can carry image, a file name inside the image path without .png (the Metadata guide uses image = 'panties'), or imageurl, a URL. The Metadata guide builds several cards from one item this way.
  • Recipe images: the Qbox recipe copies the qbx_invimages pictures into ox_inventory/web/images. Servers moving from QBCore copy their pictures from qb-inventory/html/images.

The docs do not give a required image size.

How to make an ox_inventory item usable

An item does something when used in one of three ways.

  1. Built-in effects. client.status or client.usetime makes ox_inventory run the whole use itself: progress bar, status change and removal of the consume count. anim, prop, disable and notification then shape that progress bar and the message after it. The burger above works this way.
  2. An export. Set client.export or server.export to resourceName.exportName. For client callbacks the docs recommend an export over editing items/client.lua. Inside the export, exports.ox_inventory:useItem passes the use back to ox_inventory, which “adds security, removes the item on use, adds progressbar support, and is necessary for server callbacks”.
  3. The framework’s own usable-item callback. The docs say ESX servers can keep using ESX.RegisterUsableItem and Qbox servers exports.qbx_core:CreateUseableItem, and add that “Using the built-in system is more secure and provides much more functionality.”

This is the client export example from the Creating Items page:

exports('bandage', function(data, slot)
    local playerPed = PlayerPedId()
    local maxHealth = GetEntityMaxHealth(playerPed)
    local health = GetEntityHealth(playerPed)

    -- Does the ped need to heal? We can cancel the item from being used.
    if health < maxHealth then
        -- Triggers internal-code to correctly use items.
        -- This adds security, removes the item on use, adds progressbar support, and is necessary for server callbacks.
        exports.ox_inventory:useItem(data, function(data)
            -- The server has verified the item can be used.
            if data then
                SetEntityHealth(playerPed, math.min(maxHealth, math.floor(health + maxHealth / 16)))
                lib.notify({description = 'You feel better already'})
            end
        end)
    else
        -- Don't use the item
        lib.notify({type = 'error', description = 'You don\'t need a bandage right now'})
    end
end)

A server export receives the event name, the item, the inventory, the slot and extra data. The Metadata guide’s example item sets server = { export = 'pokemon.pokemon_card' } and reacts to the usingItem event:

exports('pokemon_card', function(event, item, inventory, slot, data)
    if event == 'usingItem' then
        local itemSlot = exports.ox_inventory:GetSlot(inventory.id, slot)
        print(json.encode(itemSlot.metadata, {indent=true}))
    end
end)

If the export returns false during usingItem, ox_inventory stops the use.

Why ESX.RegisterUsableItem or CreateUseableItem is ignored

ox_inventory hands an item to the framework callback only when the item has no consume value and is not a weapon. An item with a consume value is used inside ox_inventory, and the framework callback never runs.

The docs give consume a default of 1, but the loader sets that default only when the item has client.status, client.usetime, client.export or server.export. So an item meant for ESX.RegisterUsableItem or CreateUseableItem should stay plain, like the lockpick entry: a label, a weight, and none of those four fields. consume = 0, used by the stock paper bag and phone, also counts as a value and keeps the use inside ox_inventory.

What differs on Qbox, ESX and QBCore

FrameworkWhere you add itemsinventory:frameworkUsable-item callback
Qboxox_inventory/data/items.luaqbxexports.qbx_core:CreateUseableItem
ESX Legacy with ox_inventoryox_inventory/data/items.lua; rows of the items table are copied inesx (the default)ESX.RegisterUsableItem
QBCore with qb-inventoryqb-core/shared/items.luaNot supportedQBCore.Functions.CreateUseableItem

The framework comparison explains which framework fits a new server.

Qbox add items: ox_inventory, not qbx_core

On Qbox, ox_inventory is the only item list. The Qbox docs say items are defined by ox_inventory in ox_inventory/data/items.lua, not in qb-core, and the qbx_core/shared/items.lua file now opens with a notice that it is deprecated and that items belong in ox_inventory/data/items.lua.

  • Framework setting. The ox_inventory Qbox page says to add the line below before your resources start, and to start ox_inventory immediately after qbx_core. The Qbox recipe’s ox.cfg already contains it.
setr inventory:framework "qbx"
  • Versions. The Qbox bridge in ox_inventory v2.48.1 refuses to start without qbx_core 1.18.1 or newer and qbx_vehicles 1.2.0 or newer. qbx_core was at v1.24.1, released October 30, 2026.
  • QBCore scripts on Qbox. QBCore.Shared.Items is built from ox_inventory’s items. exports['qb-core']:AddItem, AddItems and UpdateItem cannot create real items; they update QBCore.Shared.Items and print an entry for you to paste into ox_inventory.
  • Callback data. exports.qbx_core:CreateUseableItem(item, data) registers a function that receives the player’s source and the item. Qbox notes that this item has count and metadata, not QBCore’s amount and info.
  • Hunger and thirst. Qbox keeps status values from 0 to 100. A client.status value above 100 or below -100 is treated as an ESX-style value and multiplied by 0.0001, so the burger’s hunger = 200000 adds 20.
  • Items from QBCore. The convertqbitems console command turns QBCore item definitions into ox_inventory entries and writes the ones ox_inventory lacks to qbx_core/converted.lua, for you to paste into ox_inventory/data/items.lua. The full procedure is in migrating QBCore to Qbox. The Qbox docs list what the converter changes:
QBCore fieldox_inventory field
label, weight, descriptionThe same
unique = truestack = false
shouldClose = falseclose = false
decay (days)degrade (minutes)
imageclient.image, only when the picture is not named after the item
useable, type, combinable, ammotypeLeft out

ESX add items: data/items.lua and the database copy

ox_inventory needs ESX Legacy 1.6.0 or newer. Its ESX page warns that it replaces the item, inventory and weapon systems of ESX, so loadouts no longer exist and weapons become items. The official ESX recipe installs ox_lib but not ox_inventory, and es_extended shows its own inventory while Config.CustomInventory is false. Install ox_inventory from its latest release; a git clone of the source only runs after you build its web UI with bun i and bun run build, as the docs show.

  • Start order. The docs give the order below, with your framework in place of framework, and list ox_target as an optional dependency. The ESX page’s own example still starts qtarget there, but the main docs call qtarget deprecated, and the v2.48.1 code only checks for ox_target.
start oxmysql # this should be one of the first resources
start ox_lib
start framework # the name of your framework (i.e. ox_core, es_extended, qbx_core)
start ox_target
start ox_inventory
  • No es_extended edit needed. In ESX 1.16.4, es_extended sets Config.CustomInventory = "ox" by itself when the ox_inventory resource exists, and its config says not to change that value. inventory:framework already defaults to esx.
  • The database copy. At every start on ESX, ox_inventory reads the items table. Any row it does not already know is appended to data/items.lua with its label, weight, stack, close and description. The console then says the items “have been copied from the database” and that you “should restart the resource to load the new items”. So an ESX script that inserts SQL item rows still works: start, restart, and the items are in the file.
  • Check copied weights. The copy keeps the number from the weight column as it is. ESX’s own SQL file gives bread a weight of 1, which ox_inventory then shows as 1g. Correct such values in data/items.lua.
  • Old inventories. convertinventory esx, typed in the server console, converts player inventories to the ox_inventory format, and convertinventory esxproperty is optional. The command only runs from the server console. Restart when it finishes.
  • Usable items. ESX.RegisterUsableItem keeps working for plain items, as explained above. The ESX docs example:
ESX.RegisterUsableItem('bread', function(playerId)
    local xPlayer = ESX.GetPlayerFromId(playerId)
    xPlayer.removeInventoryItem('bread', 1)
    xPlayer.showNotification('That was delicious.. right?')
end)

The ox_inventory ESX page notes that xPlayer item functions such as xPlayer.getInventoryItem still work but are deprecated in favor of the exports.ox_inventory functions. client.status values go to esx_status after the item is used: through a server event on ESX 1.16.0 and newer, and through client events on older versions.

QBCore add items: qb-core/shared/items.lua

ox_inventory does not support QBCore. Its README lists ox_core, esx, qbox and nd_core as supported frameworks, and the inventory:framework convar accepts ox, esx, qbx and nd. For any other framework, the docs say you have to write the bridge yourself. QBCore’s docs also say it “has withdrawn from other platforms” and keep the existing pages as a reference.

On a QBCore server with qb-inventory, items live in qb-core/shared/items.lua. Each entry has name, label, weight, type, image, unique, useable, shouldClose and description, and image is a file name inside qb-inventory/html/images. This entry is from the stock file:

QBCore.Shared.Items = {
    water_bottle = { name = 'water_bottle', label = 'Bottle of Water', weight = 500, type = 'item', image = 'water_bottle.png', unique = false, useable = true, shouldClose = true, description = 'For all the thirsty out there' },
}

useable = true alone does nothing: the QBCore docs say the item must still be registered as usable, which QBCore.Functions.CreateUseableItem(item, data) does. A resource can also add an item while the server runs with exports['qb-core']:AddItem(itemName, item). To run ox_inventory, the supported route from QBCore is a move to Qbox, which the ox_inventory Qbox page strongly advises as an alternative to QBCore.

Does this work on FiveM for GTAV Enhanced?

Nothing in the item format belongs to one platform: an item is an entry in data/items.lua and a PNG in web/images. The Qbox recipe, which installs ox_inventory, is listed in indexv5.json, the txAdmin recipe index added for Enhanced servers on July 23, 2026.

On Enhanced, every resource has NUI callback strict mode on by default. The Cfx docs say strict mode only lets the NUI of the resource that registered a callback call it. ox_inventory’s screen sends its requests to its own resource name, so strict mode does not stand in its way. What stays open is that ox_inventory’s README and docs say nothing about Enhanced as of November 21, 2026. Try the inventory on an Enhanced test server before you go live.

Troubleshooting

ox_inventory item image not showing

  • Cause: the file name does not match the key. Fix: rename the file to the exact lowercase key plus .png, or point client.image at the file, extension included.
  • Cause: the image is not a PNG, or sits outside ox_inventory/web/images. Fix: save it as PNG in that folder and restart the server.
  • Cause: inventory:imagepath points somewhere else. Fix: put the picture where that convar points, or remove the convar to use the default.

/giveitem does nothing

  • Cause: the name matches no item. The command looks the name up and does nothing at all when it is unknown. Fix: check spelling and use the lowercase key from data/items.lua.
  • Cause: you are not in group.admin. Fix: add your identifier to that group, then try again.
  • Cause: the item list did not reload. Fix: restart the server and check the Inventory has loaded count in the console.
  • Cause: the item exists but could not be added. The server console then prints a line that starts with Failed to give and ends with the reason in brackets, such as inventory_full. Fix: free a slot in the target inventory and give the item again.

exports.ox_inventory:AddItem returns “invalid_item”

The docs list three failure responses for AddItem: invalid_item means the item does not exist, invalid_inventory means the inventory does not exist, and inventory_full means there are no free slots. For invalid_item, define the item in data/items.lua and restart.

Items disappeared from inventories after editing items.lua

A loading inventory keeps only items whose names are in the list, and what was loaded is what gets saved. If you renamed or removed an entry, put the old key back and restart as soon as possible. Inventories that were loaded and saved while the name was missing no longer contain that stack.

ESX.RegisterUsableItem or CreateUseableItem never runs

The item has a consume value, either set by you or added because of client.status, client.usetime, client.export or server.export. ox_inventory then uses the item itself. Remove those fields so the framework callback is called, or move the logic into an export.

“es_extended has not been configured to enable support for ox_inventory!”

ox_inventory prints this when Config.CustomInventory in es_extended is something other than "ox". es_extended 1.16.4 sets the value itself when the ox_inventory resource exists, so check that ox_inventory is in your resources folder and that nobody hard-coded another value in the es_extended config.

Console warns “unable to generate … item does not exist”

The inventory:vehicleloot or inventory:dumpsterloot convar names an item that is not defined. The docs’ example loot list uses cola, while the stock item file and the code default use sprunk, and the stock file has no cola item. Use names that exist in your data/items.lua, or define the missing item.

ox_inventory looks for es_extended on a Qbox server

inventory:framework defaults to esx when the convar is missing, and ox_inventory loads the bridge named by that convar. On a Qbox server it then runs its ESX bridge, which requires es_extended and asks it for the ESX shared object, instead of its Qbox bridge. Add setr inventory:framework "qbx" before your resources start, as the Qbox recipe’s ox.cfg does.

Next Steps

Official documentation and repository references