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.

- 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
On this page
- Direct Answer
- How ox_inventory items work
- Step by step: add an item to ox_inventory/data/items.lua
- Every field of an ox_inventory item
- ox_inventory item images: folder, file name and format
- How to make an ox_inventory item usable
- What differs on Qbox, ESX and QBCore
- Does this work on FiveM for GTAV Enhanced?
- Troubleshooting
- Next Steps
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/giveitemor 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 withweight = 220reads as 220g.
Step by step: add an item to ox_inventory/data/items.lua
- Open the file. It is
data/items.luainside theox_inventoryresource folder. A server deployed from the Qbox txAdmin recipe has the resource inresources/[ox]/ox_inventory, and the recipe replaced the stockdata/items.luawith Qbox’s own list. Edit the file your server runs. - 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 insidereturn { }the way the file holds them; paste only the entry, not a secondreturn {.
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,
},
}
- Add the picture. Save a PNG named exactly like the key, such as
lockpick.png, inox_inventory/web/images. The image rules are in the section below. - Restart the server. The item list is read when the resource starts. During startup, ox_inventory prints the message
Inventory has loaded <count> itemsin the console; the count includes the weapons, ammo and attachments fromdata/weapons.lua. - Give the item to yourself. The
/giveitemcommand, also registered as/additem, takes a player (memeans you), the item name, an optional count and an optionaltypemetadata value. It is restricted togroup.admin; the admin permissions guide shows how to get that group. The Qbox docs run this check in game after typing/optinin 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.
| Field | Type | What it does | Default |
|---|---|---|---|
label | string | Name shown in the inventory | Always set it |
weight | number | Weight in grams | 0 |
stack | boolean | false gives every item its own slot | true |
close | boolean | false keeps the inventory open when the item is used | true |
description | string | Text shown in the tooltip | None |
consume | number | Count needed and removed per use; a decimal uses durability instead (0.2 = 20%) | 1 in the docs; see below |
degrade | number | Minutes until the item has fully degraded | None |
decay | boolean | true deletes the item when durability reaches 0 | None |
allowArmed | boolean | true allows use while holding a weapon | None |
buttons | table | Context menu buttons, each with a label and an action(slot) function | None |
server.export | string | Export called on the server when the item is used | None |
client | table | Client options, next table | None |
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 field | What it does |
|---|---|
image | Image file name inside the image folder, or a full URL; replaces the default <name>.png |
status | Status changes after use, such as { hunger = 200000 }; the docs describe them as esx_status values |
anim | Animation during the progress bar: a table with dict and clip, or a preset name such as 'eating' from data/animations.lua |
prop | Prop held during the progress bar: model, pos, rot, optional bone and rotOrder, or a preset name such as 'burger' |
disable | Actions blocked during the progress bar: move, car, combat, mouse, sprint; ox_inventory blocks combat unless you set combat = false |
usetime | Length of the progress bar; without it there is no progress bar (the stock food items use 2500) |
cancel | true lets the player cancel the use |
notification | Text shown after a successful use |
export, event | Export 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, remove | Functions 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. Alockpickentry looks forlockpick.png. - Format: PNG. The resource manifest lists
web/images/*.pngas the image files sent to players. - A different file: set
client.imageto the file name with its extension. The stocktestburgerusesimage = 'burger_chicken.png'andidentificationusesimage = 'card_id.png'. A value that starts with a scheme such ashttps://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 usesimage = 'panties'), orimageurl, a URL. The Metadata guide builds several cards from one item this way. - Recipe images: the Qbox recipe copies the
qbx_invimagespictures intoox_inventory/web/images. Servers moving from QBCore copy their pictures fromqb-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.
- Built-in effects.
client.statusorclient.usetimemakes ox_inventory run the whole use itself: progress bar, status change and removal of theconsumecount.anim,prop,disableandnotificationthen shape that progress bar and the message after it. The burger above works this way. - An export. Set
client.exportorserver.exporttoresourceName.exportName. For client callbacks the docs recommend an export over editingitems/client.lua. Inside the export,exports.ox_inventory:useItempasses the use back to ox_inventory, which “adds security, removes the item on use, adds progressbar support, and is necessary for server callbacks”. - The framework’s own usable-item callback. The docs say ESX servers can keep using
ESX.RegisterUsableItemand Qbox serversexports.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
| Framework | Where you add items | inventory:framework | Usable-item callback |
|---|---|---|---|
| Qbox | ox_inventory/data/items.lua | qbx | exports.qbx_core:CreateUseableItem |
| ESX Legacy with ox_inventory | ox_inventory/data/items.lua; rows of the items table are copied in | esx (the default) | ESX.RegisterUsableItem |
| QBCore with qb-inventory | qb-core/shared/items.lua | Not supported | QBCore.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’sox.cfgalready contains it.
setr inventory:framework "qbx"
- Versions. The Qbox bridge in ox_inventory v2.48.1 refuses to start without
qbx_core1.18.1 or newer andqbx_vehicles1.2.0 or newer.qbx_corewas at v1.24.1, released October 30, 2026. - QBCore scripts on Qbox.
QBCore.Shared.Itemsis built from ox_inventory’s items.exports['qb-core']:AddItem,AddItemsandUpdateItemcannot create real items; they updateQBCore.Shared.Itemsand 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 hascountandmetadata, not QBCore’samountandinfo. - Hunger and thirst. Qbox keeps status values from 0 to 100. A
client.statusvalue above 100 or below -100 is treated as an ESX-style value and multiplied by 0.0001, so the burger’shunger = 200000adds 20. - Items from QBCore. The
convertqbitemsconsole command turns QBCore item definitions into ox_inventory entries and writes the ones ox_inventory lacks toqbx_core/converted.lua, for you to paste intoox_inventory/data/items.lua. The full procedure is in migrating QBCore to Qbox. The Qbox docs list what the converter changes:
| QBCore field | ox_inventory field |
|---|---|
label, weight, description | The same |
unique = true | stack = false |
shouldClose = false | close = false |
decay (days) | degrade (minutes) |
image | client.image, only when the picture is not named after the item |
useable, type, combinable, ammotype | Left 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 listox_targetas an optional dependency. The ESX page’s own example still startsqtargetthere, but the main docs call qtarget deprecated, and the v2.48.1 code only checks forox_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 theox_inventoryresource exists, and its config says not to change that value.inventory:frameworkalready defaults toesx. - The database copy. At every start on ESX, ox_inventory reads the
itemstable. Any row it does not already know is appended todata/items.luawith 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
weightcolumn as it is. ESX’s own SQL file gives bread a weight of 1, which ox_inventory then shows as 1g. Correct such values indata/items.lua. - Old inventories.
convertinventory esx, typed in the server console, converts player inventories to the ox_inventory format, andconvertinventory esxpropertyis optional. The command only runs from the server console. Restart when it finishes. - Usable items.
ESX.RegisterUsableItemkeeps 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 pointclient.imageat 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:imagepathpoints 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 loadedcount in the console. - Cause: the item exists but could not be added. The server console then prints a line that starts with
Failed to giveand ends with the reason in brackets, such asinventory_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
- Choose or confirm your framework with QBCore vs Qbox vs ESX Legacy.
- Move a QBCore server and its items to ox_inventory with how to migrate QBCore to Qbox.
- Register custom guns as inventory items with how to add addon weapons to FiveM.
- Install the resource that will use your new items with how to install FiveM scripts, or browse FiveCrate’s scripts category.
FiveM scripts from FiveCrate
Listed in the FiveCrate catalogue now.
Official documentation and repository references
- Overextended Docs: ox_inventory, Creating Items
- Overextended Docs: ox_inventory installation and config
- Overextended Docs: ox_inventory with Qbox
- Overextended Docs: ox_inventory with ESX
- ox_inventory source: data/items.lua (v2.48.1)
- Qbox Docs: Migrating, server setup (Items)
- Qbox Docs: Migrating, your own scripts
- QBCore Docs: Shared (Items)
Related guides
How to Add Addon Weapons to FiveM (ox_inventory)
How to add addon weapons to FiveM: stream folder, data_file lines for weapons.meta, ox_inventory weapons.lua, images, attachments, QBCore and ESX steps.
How to Install FiveM Scripts and Resources Safely
How to install FiveM scripts: check the files, put the folder in resources, add its dependencies and SQL, then set the ensure order in server.cfg.
How to Give Yourself Admin on QBCore, Qbox and ESX
How to give yourself admin on QBCore, Qbox and ESX Legacy: the add_principal lines, setgroup, /addpermission and /optin, plus fixes for Access denied errors.
How to Migrate QBCore to Qbox Safely (With a Rollback Plan)
Migrate QBCore to Qbox on a test copy: what carries over, the database and qb-inventory conversion commands, go-live day and a rollback plan from Qbox's docs.
QBCore vs ESX vs Qbox: Which FiveM Framework in 2026?
QBCore vs ESX vs Qbox in 2026, from official sources: what QBCore leaving FiveM means, how Qbox and ESX Legacy differ, and which framework fits your scripts.




