mcpField
O
ox-inventory

ox-inventory

github.com/germanfndezDevelopment1962 installsUpdated 2w ago
Repository

About ox-inventory

ox-inventory is a slot-based inventory skill for developers building with ox_inventory in ox_core, esx, or qbx_core. It guides item operations, storage setup, hooks, and inventory migrations with explicit server/client boundaries and safety checks.

Key features

  1. 01Server-side item give, remove, and count
  2. 02Stash and shop registration guidance
  3. 03Hooks for inventory actions
  4. 04Item definition and metadata rules
  5. 05Migration guidance from qb-inventory and esx

Use cases

  1. 01Implementing item rewards or trades
  2. 02Creating persistent or temporary stashes
  3. 03Reacting to inventory moves or purchases
  4. 04Migrating an existing inventory system

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/germanfndez/fiveai-skills --skill ox-inventory

After installing, type/ox-inventoryin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
client-exports.md
hooks.md
items.md
server-exports.md
stashes.md

Details

From the project README

ox_inventory

Slot-based inventory with weight, metadata, stashes, shops and hooks. Supports ox_core, esx and qbx_core.

Activation Contract

Load this skill when the user asks to give, take, count or check items, register a stash or shop, define a new item, react to inventory actions, or migrate from qb-inventory or esx inventory.

Hard Rules

  • Call everything through exports.ox_inventory:<fn>(...). There is no global table.
  • Grant, remove and count items on the SERVER only. Client exports are for display and UI decisions.
  • AddItem can fail. Always check the return value: the player may be over weight or out of slots.
  • Check CanCarryItem BEFORE taking payment or removing the traded item, never after.
  • Never invent item names. An item must exist in data/items.lua or it silently fails.
  • inv is a player source, an identifier, or a stash id. Passing the wrong one returns nil, not an error.
  • Metadata makes items non-stackable when it differs. Do not put volatile data in metadata.

Decision Gates

GoalCall
Give an itemAddItem(inv, item, count, metadata, slot)
Take an itemRemoveItem(inv, item, count, metadata, slot)
Check space firstCanCarryItem(inv, item, count, metadata)
How many does the player haveGetItemCount(inv, item, metadata, strict)
Read one slotGetSlot(inv, slot)
Find items across slotsSearch(inv, 'slots'|'count', item, metadata)
Persistent storageRegisterStash(...)
Short-lived storageCreateTemporaryStash(properties)
React to a player actionregisterHook(event, cb, options)

Execution Steps

  1. Confirm ox_inventory starts after ox_lib and the framework core.
  2. Decide the side: mutation is server, display is client.
  3. For a trade or reward, order the calls: CanCarryItem -> take payment -> AddItem -> verify the return.
  4. Define any new item in data/items.lua before referencing it. Read rules/items.md.
  5. Use hooks instead of polling when reacting to moves, opens or purchases.

Output Contract

Return runnable Lua using exports.ox_inventory, with the server/client split explicit. Include the data/items.lua entry whenever a new item is introduced.

References

  • rules/server-exports.md — item and inventory functions on the server.
  • rules/client-exports.md — weight, current weapon, opening inventories.
  • rules/items.md — defining items in data/items.lua.
  • rules/stashes.md — stashes, shops and temporary storage.
  • rules/hooks.md — registerHook and cancelling actions.

Upstream docs: https://overextended.dev/ox_inventory

Comments

Markdown supported