Backwards Compatibility
One Inventory ships compatibility layers so resources written for other inventories keep working without edits. This page lists exactly what we implement, per framework and per inventory script.
ox_inventory is running, and likewise for qb-inventory. Any name not listed below is intentionally unsupported and will error if called.restart one_inventory keeps these exports working. The ox_inventory stop and start events fire for the alias, so consuming resources drop their cached references and re-register their hooks exactly as they do with the real ox_inventory. One FiveM client limitation remains: players who were connected during the restart read GetResourceState('ox_inventory') as uninitialized on the client until they reconnect. Exports and hooks are unaffected.Resource detection
one_inventory provides the ox_inventory resource name. While no real ox_inventory is started, GetResourceState('ox_inventory') returns started, dependency 'ox_inventory' in a manifest resolves to one_inventory, and GetResourceMetadata('ox_inventory', ...) reads one_inventory's manifest, so scripts that auto-detect ox_inventory pick one_inventory without changes. A started real ox_inventory always wins those lookups, which is what the migration flow relies on.
GetResourceMetadata('ox_inventory', 'version', 0)returns one_inventory's version. Scripts that gate on an ox version number (lib.checkDependency('ox_inventory', '2.x')) still need that check removed, exactly as before. See the QBox installation patches.qb-inventoryis not provided. Scripts that check for a startedqb-inventorydo not detect one; the qb-inventory exports below work regardless.- To switch the alias off, remove the
provide 'ox_inventory'line fromfxmanifest.lua. Theexports.ox_inventoryfunctions keep answering.
ESX
Exposed as xPlayer methods (via the es_extended patch), so they resolve on any ESX player object exactly as before.
| Method | Supported | Notes |
|---|---|---|
addInventoryItem | ||
removeInventoryItem | ||
setInventoryItem | ||
getInventoryItem | ||
hasItem | ||
getInventory | Supports the minimal argument. | |
canCarryItem | ||
canSwapItem | ||
setMaxWeight | ||
getLoadout | Returns {}; weapons live in slots. | |
setAccountMoney | ||
addAccountMoney | ||
removeAccountMoney | ||
syncInventory |
Usable items keep working through ESX's native registry: RegisterUsableItem and GetUsableItems are consumed directly (see Usable Items). On the client, ESX.PlayerData.inventory and ESX.PlayerData.maxWeight stay populated.
QBCore / QBox
Exposed as Player.Functions methods, so they resolve on any QB / QBox player object exactly as before.
| Method | Supported |
|---|---|
AddItem | |
RemoveItem | |
GetItemByName | |
GetItemBySlot | |
GetItemsByName | |
ClearInventory | |
GetItemCount | |
HasItem | |
CanCarryItem | |
SetInventory |
QBCore.Shared.Items and QBCore.Shared.Weapons are populated from One Inventory's definitions, and PlayerData.items is kept in sync, so legacy reads keep working. Usable items keep working through CreateUseableItem (consumed natively). Money methods (AddMoney / RemoveMoney / SetMoney / GetMoney) are intentionally left to QB and kept in sync.
ox_inventory
Available through exports.ox_inventory:Name(...), with the same signatures as ox. Calling an ox-only name on exports.one_inventory instead of exports.ox_inventory fails; the server console prints which resource called it and which export to use instead.
Server exports
| Export | Supported |
|---|---|
AddItem | |
RemoveItem | |
SetItem | |
GetItem | |
GetItemCount | |
Search | |
GetSlot | |
GetSlotWithItem | |
GetSlotIdWithItem | |
GetSlotIdsWithItem | |
GetSlotsWithItem | |
GetEmptySlot | |
GetCurrentWeapon | |
GetItemSlots | |
GetSlotForItem | |
CanCarryItem | |
CanCarryAmount | |
CanCarryWeight | |
CanSwapItem | |
SetMaxWeight | |
SetSlotCount | |
SetDurability | |
SetMetadata | |
GetInventory | |
Inventory | |
GetInventoryItems | |
GetInventories | |
SwapSlots | |
ClearInventory | |
RemoveInventory | |
registerHook | |
removeHooks | |
Items | |
ItemList | |
forceOpenInventory | |
CustomDrop | |
CreateDropFromPlayer | |
InspectInventory | |
ConfiscateInventory | |
ReturnInventory | |
UpdateVehicle | |
ConvertItems | |
RegisterShop | |
RegisterStash | |
setPlayerInventory | |
setContainerProperties | |
GetContainerFromSlot |
RegisterStash and setPlayerInventory are accepted and do nothing: stashes are created the first time they are opened, and player inventories load by themselves. RegisterStash also answers on exports.one_inventory for scripts that call it on whichever inventory is started. CreateTemporaryStash is not supported. ClearInventory accepts a single item name or a list for keep, and loads a stash nobody has opened yet before clearing it.
ox hook events supported through registerHook: swapItems, buyItem, createItem, openInventory, openShop, usingItem, craftItem (with the itemFilter, inventoryFilter, typeFilter, print options).
Hook payloads carry ox's inventory ids: a stash's name (name or name:owner), trunk<plate>, glove<plate>, drop-<id>, and the player's server id, so inventoryFilter patterns and id comparisons written for ox keep matching.
Client exports
| Export | Supported |
|---|---|
Search | |
GetItemCount | |
GetPlayerItems | |
GetPlayerWeight | |
GetPlayerMaxWeight | |
GetSlotIdWithItem | |
GetSlotIdsWithItem | |
GetSlotWithItem | |
GetSlotsWithItem | |
openInventory | |
openNearbyInventory | |
Items | |
ItemList | |
closeInventory | |
useItem | |
useSlot | |
getCurrentWeapon | |
giveItemToTarget | |
displayMetadata | |
weaponWheel | |
setStashTarget | |
suppressItemNotifications | |
setGetPlayerNameMethod |
weaponWheel, setStashTarget, suppressItemNotifications and setGetPlayerNameMethod are accepted and do nothing (one_inventory keeps the weapon wheel disabled, has no ox_target stash wiring, and uses its own notifications and name resolver).
Client net events supported: ox_inventory:disarm (forwards to the client DisarmPlayer export).
qb-inventory
Available through exports['qb-inventory']:Name(...), with the same signatures as qb-inventory.
Server exports
| Export | Supported |
|---|---|
AddItem | |
RemoveItem | |
SetItemData | |
GetItemByName | |
GetItemBySlot | |
GetItemsByName | |
GetItemCount | |
GetTotalWeight | |
GetFreeWeight | |
HasItem | |
CanAddItem | |
ClearInventory | |
SaveInventory | |
LoadInventory | |
SetInventory | |
GetInventory | |
GetSlots | |
GetSlotsByItem | |
GetFirstSlotByItem | |
UseItem | |
OpenInventory | |
OpenInventoryById | |
CloseInventory | |
OpenShop | |
RemoveInventory | |
ClearStash | |
CreateShop |
Legacy net events supported: qb-inventory:server:useItem, inventory:server:OpenInventory.
Client exports
| Export | Supported |
|---|---|
HasItem |
