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

  1. Clone the latest qb-inventory release into your resources/[qb]/ folder.
  2. Import the optional SQL file if you are migrating from a very old release (modern versions manage tables automatically).
  3. Verify that ensure qb-inventory appears in server.cfg after qb-core.
  4. Confirm item images are copied into qb-inventory/html/images.
  5. 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 as QBCore.Functions.CreateUseableItem and QBCore.Functions.GetPlayer inventory operations.
  • The UI assets live in html/js/app.js and html/css/app.css; customize carefully to avoid breaking drag behaviour.
  • To add new stash types, extend QBCore.Shared.Stashes in qb-core/shared/items.lua or register them via exports at runtime.

Common Integrations

IntegrationNotes
qb-shopsUses qb-inventory to show store inventory menus and handle purchases.
qb-policejobRelies on player inventory metadata for evidence locker and confiscation systems.
qb-housesProvides stash data for player-owned properties.
qb-garagesUses trunk and glovebox inventory exports for vehicles.
Custom craftingRegister 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 the html/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

SymptomResolution
Items disappear on useConfirm the item is registered with useable = true and that the use callback removes the correct amount.
Hotbar slots resetDelete qb-inventory/html/js/app.js in the player cache folder to clear stale UI data.
Weight limits ignoredVerify Config.MaxWeight and per-item weight values are set properly in shared/items.lua.
Images missingEnsure the PNG file name matches the item image value and that the file lives inside qb-inventory/html/images.

Further Reading