# Defining items in QBCore

> How QBCore items work: every field in qb-core/shared/items.lua, weapon items with ammotype, useable items, the AddItem export and qb-inventory images.

Source: https://fam-tools.com/guides/qbcore-shared-items · FAM Tools · published 2026-09-11 · updated 2026-09-11 · about 9 min

**Short answer.** Each entry in `QBCore.Shared.Items` has `name`, `label`, `weight`, `type` (`item` or `weapon`), `image`, `unique`, `useable`, `shouldClose` and `description`; weapon items add `ammotype`. Make an item usable with `QBCore.Functions.CreateUseableItem`, put its image in qb-inventory’s images folder, and add items from your own resource at runtime with `exports['qb-core']:AddItem(name, data)`.

## Key points

- Weapons are items too (`type = 'weapon'`, `unique = true`).
- `useable = true` + `CreateUseableItem` to use it.
- `unique = true` = does not stack.
- Runtime items: `exports['qb-core']:AddItem` / `AddItems`.
- Image file name must match `image`.

On a QBCore server with qb-inventory, every item — food, tools, documents and even weapons — starts as a line in `qb-core/shared/items.lua`. The format is compact, and a missing or mistyped field is behind most “item does not show” problems.

## The format

*qb-core/shared/items.lua*

```lua
QBCore.Shared.Items = {
    pistol_ammo = { name = 'pistol_ammo', label = 'Pistol ammo', weight = 200, type = 'item', image = 'pistol_ammo.png', unique = false, useable = true, shouldClose = true, description = 'Ammo for Pistols' },
    weapon_pistol = { name = 'weapon_pistol', label = 'Walther P99', weight = 1000, type = 'weapon', ammotype = 'AMMO_PISTOL', image = 'weapon_pistol.png', unique = true, useable = false, description = 'A small firearm designed to be held in one hand' },
}
```

| Field | Meaning |
| --- | --- |
| `name` | Item ID (same as the key, lowercase) |
| `label` | Display name |
| `weight` | Weight in the inventory’s units (grams in the default setup) |
| `type` | `item` or `weapon` |
| `ammotype` | Weapons only: GTA ammo type, e.g. `AMMO_PISTOL` |
| `image` | File in the inventory’s images folder |
| `unique` | `true` = never stacks |
| `useable` | Can be used from the inventory |
| `shouldClose` | Close the inventory on use |
| `description` | Tooltip text |

## Making an item usable

*server.lua*

```lua
local QBCore = exports['qb-core']:GetCoreObject()

QBCore.Functions.CreateUseableItem('pistol_ammo', function(source, item)
    TriggerClientEvent('weapons:client:AddAmmo', source, 'AMMO_PISTOL', 12, item)
end)
```

The event name above is what qb-weapons uses for ammo; for your own items trigger your own events. Scripting basics: [QBCore tutorial](https://pityus.net/guides/qbcore-script-tutorial).

## Adding items from your resource

*server.lua (your resource)*

```lua
exports['qb-core']:AddItems({
    fish = { name = 'fish', label = 'Fish', weight = 400, type = 'item', image = 'fish.png', unique = false, useable = false, shouldClose = false, description = 'Freshly caught' },
})
```

This keeps your resource self-contained instead of asking buyers to edit qb-core. Weapon definitions live in a separate table — see [QBCore shared weapons](https://fam-tools.com/guides/qbcore-shared-weapons).

## Questions

### How do I add an item in QBCore?

Add an entry to `qb-core/shared/items.lua` (or call `exports['qb-core']:AddItem` from your resource) and add its image to the inventory’s images folder.

### Are weapons items in QBCore?

Yes — `type = 'weapon'` with an `ammotype`, plus an entry in `shared/weapons.lua`.

### Why can I not use my item?

`useable` is false or no `CreateUseableItem` handler is registered.

### What does unique mean?

The item never stacks; each one takes its own slot.

## Related

- https://fam-tools.com/guides/qbcore-shared-weapons
- https://fam-tools.com/guides/qbcore-weapon-setup
- https://fam-tools.com/guides/fivem-inventory-systems-compared
- https://fam-tools.com/guides/fivem-weapon-item-images
