# Defining items in ox_inventory

> Create items in ox_inventory data/items.lua: label, weight, stack, consume, degrade, client options, server exports, buttons, images and usable items.

Source: https://fam-tools.com/guides/ox-inventory-items-lua · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 11 min

**Short answer.** 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/`.

## Key points

- `weight` is in grams.
- `stack = false` = unique items (phones, IDs).
- `consume = 0` never consumes; `consume = 0.3` uses 30% durability.
- `degrade = 60` = decays over 60 minutes.
- Custom use logic via `client.export` / `server.export` into your own resource.

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

*ox_inventory/data/items.lua*

```lua
['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

*items.lua — bandage*

```lua
['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

*items.lua*

```lua
['repairkit'] = {
    label = 'Repair Kit',
    weight = 2500,
    client = { export = 'my_mechanic.repairkit' },
    server = { export = 'my_mechanic.repairkit' },
},
```

*my_mechanic/client.lua*

```lua
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)
```

*my_mechanic/server.lua*

```lua
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](https://fam-tools.com/guides/ox-inventory-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](https://fam-tools.com/guides/fivem-weapon-item-images). Pictures for the entries are the slow part: [FAM Tools keeps a free icon library](https://fam-tools.com/free-tools/item-icons) with the items.lua line written out beside each one.

## Questions

### How do I add an item to ox_inventory?

Add a table to `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?

Grams.

### How do I make an item not disappear on use?

Set `consume = 0`.

### How do I run my own code when an item is used?

Set `client.export` and/or `server.export` to `resource.exportName` and define those exports in your resource.

## Related

- https://fam-tools.com/guides/ox-inventory-weapon-setup
- https://fam-tools.com/guides/ox-inventory-metadata
- https://fam-tools.com/guides/ox-inventory-weapons-data
- https://fam-tools.com/guides/fivem-weapon-item-images
