Updated 2026-10-11 · 5 min read
qb-crafting: recipes, workbenches and XP
The qb-crafting repository contains item and attachment crafting benches, ingredient requirements, crafting reputation and an optional minigame. The README is short; the actual integration contract is in the Lua source.
Important: The reviewed server has security and transaction-integrity limitations. Read the security section before enabling this resource for real players.
Requirements and installation
The manifest loads QBCore locale helpers, config.lua, client.lua and server.lua. It does not itself enumerate all runtime dependencies.
The source calls these resources:
qb-core— shared item definitions, callbacks and player reputationqb-inventory— ingredients, crafted items and workbench itemsqb-input— amount selectionqb-menu— available recipesqb-target— interactions with spawned crafting benchesqb-minigames—SkillbarwhenConfig.EnableSkillCheckis enabled- QBCore
progressbarintegration — progress UI
After downloading the official repository, start those dependencies before qb-crafting. Ensure item_bench, attachment_bench and every recipe item exist in the installed shared item definitions and inventory images. The resource ships no dedicated SQL file; it relies on player metadata/inventory persistence.
Recipe structure
The official config defines Config.item_bench and Config.attachment_bench. Each has an object model, xpType and recipes array. Config.EnableSkillCheck selects the optional skill check.
-- Example to add INSIDE Config.item_bench.recipes.
-- Ensure both item names exist in your installed shared item table.
{
item = 'lockpick',
xpRequired = 0,
xpGain = 1,
requiredItems = {
{ item = 'metalscrap', amount = 22 },
{ item = 'plastic', amount = 32 },
},
},Fields:
| Field | Meaning |
|---|---|
item | Output item name from QBCore shared items |
xpRequired | Minimum reputation to show/unlock the recipe |
xpGain | Reputation gained per craft amount |
requiredItems | Array of material item and amount pairs |
xpType on bench | Metadata reputation key, e.g. craftingrep |
object on bench | GTA object model spawned for the bench |
Only add the recipe inside the existing table; do not duplicate Config.item_bench or assume the example is a complete config.lua.
What happens when a player crafts?
- A player uses a bench item; the client creates the bench object and adds
qb-targetinteractions. - The menu reads the player's metadata reputation and inventory using
crafting:getPlayerInventory. - The player chooses an amount via
qb-input. An enabled minigame runsexports['qb-minigames']:Skillbar('easy', '12345'). - After progress completion, the client calls
qb-crafting:server:receiveItemwith bench type, recipe output and quantity. - The server looks up the configured recipe, checks reputation, attempts ingredient removals and calls
qb-inventory:AddItemfor the result.
The menu/skill-check is a client experience, not independent authorization.
Relevant events and callbacks
| Side | Name | What it does |
|---|---|---|
| Client event | qb-crafting:client:useCraftingTable | Places the specified bench item |
| Server callback | crafting:getPlayerInventory | Supplies the current player's inventory to the menu |
| Server event | qb-crafting:server:receiveItem | Attempts to craft a configured recipe |
| Server event | qb-crafting:server:removeMaterials | Removes materials after a failed skill check |
| Server event | qb-crafting:server:removeCraftingTable | Consumes a bench item |
| Server event | qb-crafting:server:addCraftingTable | Returns a bench item on pickup |
These names are internal to the bundled resource. Avoid exposing them as generic publicly callable integrations.
Server-side validation and known limits
The reviewed server.lua validates that a requested recipe exists and that reputation is high enough. However, it does not establish all of the following:
- The numeric craft amount is a bounded positive integer (the handler converts with
tonumberand checks> 0, but not an integer or maximum). - The player is actually near and entitled to use the specified bench.
- Ingredient removal and output grant are atomic. If a later removal or output grant fails, earlier deductions are not rolled back.
- The
removeMaterialsevent validates its caller-supplied item name and amount against a failed server-verified skill check. - The separate bench return/consume events are linked to an authoritative placed bench entity.
A public server should close these gaps in a maintained fork before enabling crafting. At minimum, keep requests server-authorized, validate integer quantity and available capacity, enforce location/bench ownership, verify ingredient amounts and complete the inventory transaction with recoverable failure handling. A menu-side materials check does not protect the server.
See safe server events and the inventory API reference for related patterns.
Troubleshooting
| Symptom | Check |
|---|---|
| Crafting menu does not appear | qb-target, spawned bench entity, item registration and console |
| Blank item name or image | Correct QBCore.Shared.Items entry and Config.ImageBasePath |
| Crafting never completes | Progressbar, qb-minigames dependency and installed callback names |
| No materials recognized | crafting:getPlayerInventory response and item names |
| Recipe locked | metadata.craftingrep (or the configured xpType) and xpRequired |
| Ingredients disappear on failure | Partial non-atomic removal behavior in server.lua; investigate before reattempting |
Update checklist
- Pin the resource commit and compare upstream
config.luato local recipes. - Verify every ingredient/output/workbench item exists in your actual inventory.
- Exercise success, failure, repeated, malformed, very large and disconnected-player crafting requests on a disposable staging server.
- Do not deploy until server-side authorization and transaction boundaries are proven for your fork.
Sources
Repository · Recipe config · Client UI/workbench flow · Server events and security boundary
Found an issue in this guide?
Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.
qb-banking
Source-verified QBCore banking setup: real account exports, bank_accounts schema, ATM callbacks, shared accounts and common integration errors.
qb-inventory
Install QBCore inventory from upstream, check dependencies and SQL, use qb-inventory exports for items, shops and stashes, and diagnose common errors.
