QBCore Inventory Script
This page highlights the official qb-inventory
resource that ships with QBCore. For the full technical reference, read the dedicated qb-inventory documentation.
Overview
qb-inventory
is the default drag-and-drop inventory system maintained by the QBCore team. It supports items, shops, crafting benches, vehicle storage, and integrates tightly with other core resources such as qb-shops
, qb-banking
, and qb-trunk
.
Use this page as a quick refresher on the resource and as a checklist when upgrading or reconfiguring your server.
Core Features
- Modern drag-and-drop UI built with HTML/JS for smooth inventory management
- Support for player inventories, drops, stashes, vehicle trunks/gloveboxes, and property storage
- Built-in weight system with configurable limits per slot or container
- Hotbar integration for quick item use and weapon selection
- Compatibility with all official QBCore item metadata (durability, ammo, crafting)
- Exported events for custom scripts to open stashes or give/remove items programmatically
Installation Checklist
- Clone the latest
qb-inventory
release into yourresources/[qb]/
folder. - Import the optional SQL file if you are migrating from a very old release (modern versions manage tables automatically).
- Verify that
ensure qb-inventory
appears inserver.cfg
afterqb-core
. - Confirm item images are copied into
qb-inventory/html/images
. - Restart the server and check the console for any missing dependency warnings.
Configuration Touchpoints
config.lua
controls weight values, hotbar slots, and stash size definitions.server/main.lua
exposes helper exports such asQBCore.Functions.CreateUseableItem
andQBCore.Functions.GetPlayer
inventory operations.- The UI assets live in
html/js/app.js
andhtml/css/app.css
; customize carefully to avoid breaking drag behaviour. - To add new stash types, extend
QBCore.Shared.Stashes
inqb-core/shared/items.lua
or register them via exports at runtime.
Common Integrations
Integration | Notes |
---|---|
qb-shops | Uses qb-inventory to show store inventory menus and handle purchases. |
qb-policejob | Relies on player inventory metadata for evidence locker and confiscation systems. |
qb-houses | Provides stash data for player-owned properties. |
qb-garages | Uses trunk and glovebox inventory exports for vehicles. |
Custom crafting | Register recipes via server-side exports that interact with player inventory contents. |
Migration Tips
- Back up your
shared/items.lua
and any custom stash definitions before updating. - Use the QBCore diff viewer to review upstream changes before merging into a modified fork.
- If upgrading from legacy
qb-inventory
versions, delete thehtml/js/app.js
file before copying in the new release to avoid cached assets. - Encourage players to empty critical stashes before major updates to minimize data conflicts.
Troubleshooting
Symptom | Resolution |
---|---|
Items disappear on use | Confirm the item is registered with useable = true and that the use callback removes the correct amount. |
Hotbar slots reset | Delete qb-inventory/html/js/app.js in the player cache folder to clear stale UI data. |
Weight limits ignored | Verify Config.MaxWeight and per-item weight values are set properly in shared/items.lua . |
Images missing | Ensure the PNG file name matches the item image value and that the file lives inside qb-inventory/html/images . |