QB Inventory V2
QB Inventory V2 is an open-source project that modernises the default qb-inventory
while keeping API compatibility for most scripts.
Overview
The goal of QB Inventory V2 is to streamline performance, improve metadata handling, and make the UI easier to theme. It keeps the classic grid layout but introduces modular components that can be swapped or extended through exports.
What’s New Compared to qb-inventory
- Refactored server callbacks using
lib.callback
or optimized promise handling for faster response times - Improved item metadata persistence for attachments, quality, and custom attributes
- Modular UI components so you can replace sections (hotbar, player info, tooltip) without editing the entire HTML
- Better logging and debug tooling to track item transfers and stash access
- Optional compatibility layer for older resources that still call legacy events
Installation Steps
-
Clone the QB Inventory V2 repository into
resources/[qb]/qb-inventory-v2
. -
Comment out
ensure qb-inventory
inserver.cfg
and add the new resource:ensure qb-core ensure qb-inventory-v2
-
Import the provided SQL migration (if included) to create additional tables for metadata or stash configuration.
-
Copy your existing item images into
qb-inventory-v2/html/images
. -
Restart the server and confirm there are no errors in the console or F8 logs.
Configuration Overview
config.lua
controls weight, slot count, drop behaviour, and allowed inventory types.config.items.lua
(optional) lists custom item metadata defaults.- UI theming is handled through
html/css/app.css
and modular React/Vue components depending on the fork. - Toggle compatibility hooks for scripts that expect
qb-inventory
events such asinventory:client:ItemBox
.
Migration Checklist
- Backups: Export your database tables and item configuration before swapping.
- Exports: Update references from
qb-inventory
toqb-inventory-v2
if the fork uses different export names. - Hotbar Keybinds: Ensure the client key mapping matches your desired layout (F1/F2 or number keys).
- Testing: Validate trunk storage, gloveboxes, property stashes, and police evidence lockers.
- Cache: Ask players to clear their NUI cache after the migration so the new assets load correctly.
Troubleshooting
Problem | Fix |
---|---|
Item metadata lost on restart | Confirm the SQL migration ran successfully and that Config.Metadata is enabled. |
UI not loading | Check html/js/app.js for compile errors and verify that the NUI manifest uses the correct paths. |
Legacy scripts fail | Enable the compatibility wrapper or update scripts to call the new exports/events. |
Drag-and-drop feels sluggish | Reduce the throttling values in the UI config or disable animations for low-end clients. |
Resources
- GitHub issues page for the fork you use (often linked in the README)
- Community Discord for bug reports and feature requests
- Advanced Inventory Systems overview to explore alternative solutions