mcpField
Q
qbcore-framework

qbcore-framework

github.com/germanfndezDevelopment19238 installsUpdated 2w ago
Repository

About qbcore-framework

qbcore-framework is a skill for developers building or editing qb-core resources. It covers player data, callbacks, and server/client responsibilities, with guidance on validation and state management; it cautions against applying these APIs directly to Qbox.

Key features

  1. 01Guide to Player and PlayerData usage
  2. 02Cover callbacks, jobs, gangs, and money
  3. 03Explain item and metadata management
  4. 04Separate server and client responsibilities
  5. 05Provide validation and state-management rules

Use cases

  1. 01Create or edit qb-core resources
  2. 02Implement player money, job, or gang logic
  3. 03Exchange data between client and server using callbacks
  4. 04Review argument validation and player-state design

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/germanfndez/fiveai-skills --skill qbcore-framework

After installing, type/qbcore-frameworkin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
best-practices.md
core-concepts.md
player-methods.md
reference-links.md

Details

From the project README

QBCore Framework

Server/client API for qb-core: Player object, PlayerData, callbacks, jobs, gangs, money and metadata.

Activation Contract

Load this skill when the user creates or edits a qb-core resource, touches Player / QBCore.PlayerData, needs jobs, gangs, money, items or metadata through QBCore, or asks about QBCore callbacks, events or best practices.

This skill targets qb-core (qbcore-framework). If the user is on Qbox (qbx_core, exports.qbx_core), the APIs diverge: state it and do not apply this skill blindly.

Hard Rules

  • Acquire the core once with local QBCore = exports['qb-core']:GetCoreObject(); never call it inside every function.
  • Player exists on the SERVER only (QBCore.Functions.GetPlayer(source)). QBCore.PlayerData exists on the CLIENT only, populated after QBCore:Client:OnPlayerLoaded.
  • Always nil-check: if not Player then return end before calling any method.
  • Money, jobs, gangs, items and metadata are mutated on the server through Player.Functions.*, never from the client.
  • Pass a reason to AddMoney, RemoveMoney, SetMoney.
  • Use state bags OR events for a given piece of state, never both.
  • Validate every client-supplied argument on the server; never trust amounts, prices or item names sent by the client.
  • Prefer ox_lib for notifications, menus, dialogs and progress bars.
  • Use dynamic Wait() values in loops; avoid Wait(0) unless per-frame work is required.

Decision Gates

NeedUse
Client asks server for dataQBCore.Functions.CreateCallback + QBCore.Functions.TriggerCallback
MoneyPlayer.Functions.AddMoney/RemoveMoney/SetMoney/GetMoney(moneyType, ...)
Job / duty / gangPlayer.Functions.SetJob, SetJobDuty, SetGang
Persistent per-player flagsPlayer.Functions.SetMetaData / GetMetaData
Items (qb-inventory)Player.Functions.AddItem/RemoveItem/GetItemByName/GetItemBySlot
Shared runtime statestate bags (see rules/core-concepts.md)

Execution Steps

  1. Confirm qb-core starts before the resource; cache QBCore per side.
  2. Decide the side: mutation and validation on server, display on client.
  3. Fetch Player, nil-check, then validate every client-supplied argument.
  4. Pick the call from Decision Gates; read the matching rules file for signatures.
  5. Return data via callbacks, not paired events.

Output Contract

Return runnable Lua with the client/server split explicit, Player nil-checked, and reasons on money operations. Use ox_lib for UI unless the user asks otherwise.

References

  • rules/core-concepts.md — architecture, PlayerData, Player object, events, state bags.
  • rules/player-methods.md — Player.Functions money, job, gang, metadata, items.
  • rules/best-practices.md — naming, caching, waits, state management, security.
  • rules/reference-links.md — official QBCore documentation links.

Upstream docs: https://docs.qbcore.org

Comments

Markdown supported