Skip to content

Inventory Items and Images

Register the three inventory items, metadata and supplied images.

Restaurant registers three shared inventory item names. The actual ingredient, recipe, amount, serving details and partial consumption belong to each item's inventory item and metadata1. You do not add a separate provider item every time you create a panel material.

1. Choose the example for your inventory#

For ox_inventory, add these entries to ox_inventory/data/items.lua:

lua
['restaurant_material'] = {
    label = 'Restaurant Material', weight = 1, stack = false
},
['restaurant_product'] = {
    label = 'Restaurant Product', weight = 1, stack = false,
    close = true, consume = 0,
    server = { export = '0r-restaurant.useRestaurantProduct' }
},
['restaurant_packaged_product'] = {
    label = 'Delivery Bag', weight = 1, stack = false,
    close = true, consume = 0,
    server = { export = '0r-restaurant.usePackagedProduct' }
},

Keep consume = 0 on both usable items. Restaurant owns the verified item change; the inventory must not also remove the product automatically. Keep the entries non-stacking so unrelated metadata is not merged.

For qb-inventory, add these entries to qb-core/shared/items.lua:

lua
restaurant_material = {
    name = 'restaurant_material', label = 'Restaurant Material', weight = 1,
    type = 'item', image = 'restaurant_material.png', unique = true,
    useable = false, shouldClose = true, description = 'Restaurant materials'
},
restaurant_product = {
    name = 'restaurant_product', label = 'Restaurant Product', weight = 1,
    type = 'item', image = 'restaurant_product.png', unique = true,
    useable = true, shouldClose = true, description = 'Finished restaurant products'
},
restaurant_packaged_product = {
    name = 'restaurant_packaged_product', label = 'Delivery Bag', weight = 1,
    type = 'item', image = 'restaurant_packaged_product.png', unique = true,
    useable = true, shouldClose = true, description = 'Packed restaurant products'
},

Keep unique = true. Usable-item integration must pass the actual owned slot; a label or client-supplied product object is insufficient. See Exports when adapting a fork.

Install item images#

Copy the delivered PNG files from 0r-restaurant/ui/items/ to your selected inventory directory:

InventoryDestination
ox_inventoryox_inventory/web/images/
qb-inventoryqb-inventory/html/images/

Keep filenames and extensions intact. Reload the inventory and both Restaurant resources after installing definitions and files. Check with a newly produced real item.

Choose an image in the Materials form#

Open Kitchen > Materials, edit a material and expand Advanced. The inventory image2 field selects a local PNG basename, with an optional .png extension. For example, install chopped_tomato.png first, then select that filename. The field does not upload a file or accept a remote image URL.

Leave the field empty to keep the normal material/product image selection. Product-specific serving variants can select their own default artwork. Save and publish the material change before producing the next item.

Previously issued items retain their saved presentation metadata. Changing a material does not rewrite everything already held by players. Stock QB inventories show the fixed registered item image; per-item artwork needs metadata image support in the installed inventory UI.

Understand the amount you see#

One restaurant_material entry can be a packet and logical quantity3 containing 250 g. Its physical item count is one; its logical usable amount is 250. A finished batch can also contain several logical products within one physical entry. Do not diagnose lost quantity by looking only at the provider count.

Verify use as well as appearance#

Produce a finished product with a valid item usage profile4, use it from its actual slot, put it away, and confirm the item remains. Consume a portion and confirm only the expected portion/product changes. Raw material packets are not finished consumables. If the picture works but Use fails, follow Inventory and Consumption Problems.

Footnotes

  1. Extra details saved with an inventory item, such as its material, quantity and restaurant. Read the definition. ↩

  2. An optional PNG filename used to select an item's artwork in a supporting inventory. Read the definition. ↩

  3. One physical inventory entry holding a logical amount of a Restaurant material or product batch. Read the definition. ↩

  4. Server configuration defining how a finished product is held, opened, eaten or drunk. Read the definition. ↩