For the complete documentation index, see llms.txt. This page is also available as Markdown.

Adding items

Normal items — data/items.lua

Upstream ox_inventory fields all still work (label, weight, stack, close, description, client, server, buttons, consume…). The rework adds:

Field
Description

size = { width = 2, height = 2 }

Size in grid cells (default 1×1)

rarity

'common', 'uncommon', 'rare', 'mythic', 'legendary'

rename = true

Players can rename it

client.prop

World prop. It also enables Place and Throw.

stackModels

Prop chosen by amount

durability + decay = true

The item is deleted when durability reaches 0

['bandage'] = {
    label = 'Bandage',
    weight = 115,
    rarity = 'common',
    size = { width = 1, height = 1 },
    client = {
        anim = { dict = 'missheistdockssetup1clipboard@idle_a', clip = 'idle_a', flag = 49 },
        prop = { model = `prop_rolled_sock_02`, pos = vec3(-0.14, -0.14, -0.08), rot = vec3(-50.0, -50.0, 0.0) },
        disable = { move = true, car = true, combat = true },
        usetime = 2500,
    },
},

['money'] = {
    label = 'Money',
    stackModels = {
        { count = 1, model = `prop_anim_cash_note` },
        { count = 2, model = `prop_money_bag_01` },
    },
},

Weapons in data/weapons.lua accept size and rarity too, for example size = { width = 2, height = 1 } for rifles.

Containers — data/containers.lua

Field
Description

slots, maxWeight

Capacity

whitelist / blacklist

Items allowed / refused

isBackpack

Worn in the backpack slot, opens its own panel

quickDeposit = false

Disables quick deposit for this container

Carryable containers and safes — data/placeables.lua

Listing an item here registers it. Nothing is needed in items.lua.

Field
Description

model

World prop

distance

Max placement distance (default 3.0 m)

requireFlat

Can only be placed on a flat surface

useTarget

false disables the ox_target options

slots, maxWeight

Storage

carryFull

Can be carried while full (boxes and bags)

carryAnim, carryProp

How it is held

lock = { pin, minLength }

PIN lock (makes it a safe)

anchor = { tool, consumes, installTime, removeTime }

Can be bolted down

carryFull can't be combined with lock or anchor. If you combine them, a warning is printed and lock and anchor are ignored.

Images

  • Put a <itemname>.png file in web/images/ (100×100 is recommended).

  • Clothing items look for web/images/<slot>_<gender>_<drawable>_<texture>.png and fall back to the generic slot icon if it is missing.

  • Custom images per item: metadata.imageurl, which must point to a host in inventory:validhosts.

Last updated