Skip to Content
CoreQBCore Shared Mutation Exports

Shared mutation exports

At the verified commit, server/exports.lua exposes runtime mutation helpers for jobs, gangs, and items. These exports run on the server and notify clients after a successful change.

NamespaceAddAdd manyUpdateRemove
JobsAddJobAddJobsUpdateJobRemoveJob
GangsAddGangAddGangsUpdateGangRemoveGang
ItemsAddItemAddItemsUpdateItemRemoveItem

Each operation returns a success boolean followed by a status string. Bulk operations can also return the value that caused validation to fail.

local ok, reason = exports['qb-core']:AddItem('example_item', { name = 'example_item', label = 'Example item', weight = 100, type = 'item', image = 'example_item.png', unique = false, useable = false, shouldClose = true, combinable = nil, description = 'Example only' }) if not ok then print(('AddItem failed: %s'):format(reason)) end

Validate table data against current upstream definitions and test dependent resources after every mutation. Runtime changes are not a substitute for maintaining the deployed source definitions.

The same file defines SetMethod, SetField, and GetCoreVersion. SetMethod and SetField reject invalid names and existing keys; they do not overwrite an existing core entry.

Source: server/exports.luaΒ 

Last updated on