Defining items in ox_inventory
Add an entry to ox_inventory/data/items.lua with a label and a weight in grams. stack = false makes each item unique, close = false keeps the inventory open on use, consume sets how much is used (0 = not consumed, fractions reduce durability), and degrade makes it decay over minutes. The client table controls use: image, status, anim, prop, usetime, disable and export; a server.export runs server logic. Images go in ox_inventory/web/images/.
Every item in an ox_inventory server — food, tools, ammo, documents — is one table in data/items.lua. A few fields cover almost everything: how heavy it is, whether it stacks, what happens when it is used, and whether it wears out. This guide explains each with real examples.

#A basic item
['fish'] = {
label = 'Fish',
weight = 400,
description = 'Freshly caught. Sell it at the market.',
},
['burger'] = {
label = 'Burger',
weight = 220,
client = {
status = { hunger = 200000 },
anim = 'eating',
prop = 'burger',
usetime = 2500,
notification = 'You ate a delicious burger',
},
},#Top-level fields
| Field | Meaning |
|---|---|
label | Display name |
weight | Grams per item |
stack | false = every item is its own slot (default stacks) |
close | false = keep the inventory open when used |
description | Tooltip text |
consume | Amount used per use: 1 (default), 0 (never), or a fraction of durability |
degrade | Minutes until the item fully degrades |
buttons | Extra context-menu actions |
client / server | Use behaviour on each side |
#Client use options
['bandage'] = {
label = 'Bandage',
weight = 115,
client = {
anim = { dict = 'missheistdockssetup1clipboard@idle_a', clip = 'idle_a', flag = 49 },
prop = { model = `prop_rolled_sock_02`, pos = vec3(-0.14, -0.14, -0.08), rot = vec3(-50.0, -50.0, 0.0) },
disable = { move = true, car = true, combat = true },
usetime = 2500,
},
},status applies to supported status/needs systems; image overrides the default <item>.png file name.
#Your own use logic
['repairkit'] = {
label = 'Repair Kit',
weight = 2500,
client = { export = 'my_mechanic.repairkit' },
server = { export = 'my_mechanic.repairkit' },
},exports('repairkit', function(data, slot)
local veh = lib.getClosestVehicle(GetEntityCoords(cache.ped), 3.0, false)
if not veh then return lib.notify({ type = 'error', description = 'No vehicle nearby' }) end
exports.ox_inventory:useItem(data, function(used)
if used then SetVehicleEngineHealth(veh, 1000.0) end
end)
end)exports('repairkit', function(event, item, inventory, slot, data)
if event == 'usingItem' then
-- return false to cancel the use
elseif event == 'usedItem' then
print(('%s used a repair kit'):format(inventory.label))
end
end)useItem plays the configured animation and progress, then calls back with the result; the item is removed according to consume. Metadata such as durability and serials: item metadata.
#Item images
Put <itemname>.png (or .webp if your version supports it) in ox_inventory/web/images/. Square images of about 100–200 px keep the inventory light. Weapons use the same folder — see weapon item images. Pictures for the entries are the slow part: FAM Tools keeps a free icon library with the items.lua line written out beside each one.
Questions
How do I add an item to ox_inventory?
ox_inventory/data/items.lua with at least label and weight, add an image to web/images, and restart the server.What unit is weight in ox_inventory?
How do I make an item not disappear on use?
consume = 0.How do I run my own code when an item is used?
client.export and/or server.export to resource.exportName and define those exports in your resource.Ready to pick a map?
Twelve themes on three base map styles, $8 each, instant download.
Relevant to what you just read
The tool for this
Twenty theme pairs for ox_lib and ox_inventory From $15, built in the browser, exported as a drop-in resource.
Look it up while you work
The reference tables this guide leans on, free and without an account.
- All 21,631 object model namesEvery model CreateObject accepts, with its hash and a flag for the LOD and proxy names that spawn invisible.