# LJ Inventory

> The [LJ Inventory README](https://github.com/loljoshie/lj-inventory/blob/86ec0d8425cdc980c4dc4541841deb381f24e1e5/README.md) marks the project archived and states that support is no longer offered. This page helps audit existing installations; it does not establish compatibility with current QBCore resources.

## Overview

The source baseline is LJ Inventory commit `86ec0d84`. Its UI and legacy inventory implementation differ from current upstream `qb-inventory`. The guidance below comes from source inspection, not an executed FiveM installation or performance benchmark.

## Feature Highlights

The manifest identifies `html/ui.html` as the NUI entry point, `html/css/main.css` as its stylesheet and `html/js/app.js` as its script. The README describes image guidelines, an options menu and hotbar UI. These do not establish controller support, mobile support or improved performance on your server.

## Requirements

The [manifest](https://github.com/loljoshie/lj-inventory/blob/86ec0d8425cdc980c4dc4541841deb381f24e1e5/fxmanifest.lua) loads `@qb-weapons/config.lua` and `@oxmysql/lib/MySQL.lua`; the server obtains core through `exports['qb-core']:GetCoreObject()`. Review these dependencies before startup. The README also lists related resources such as `qb-target`, `qb-logs`, `qb-traphouse`, `qb-radio`, `qb-drugs` and `qb-shops`; inspect the code paths used by your server instead of assuming every integration is optional.

The README's historical instruction to use the “latest” core is not a current compatibility guarantee. Record exact revisions of core, inventory and every inventory consumer. Existing shared item definitions must match saved item names.

## Installation Steps

For an existing deployment or a staging evaluation:

1. Back up inventory data, shared items, resource files and local modifications. Record the installed revision.
2. Inspect the candidate manifest, dependencies and [resource load order](/docs/troubleshooting/resource-load-order).
3. Keep only one inventory provider active on staging. Identify callers using `qb-inventory` before changing a resource name; review each reference rather than running a blind global replacement.
4. Compare the candidate SQL and persistence code with your restored schema. Do not import it as a generic migration.
5. Check NUI assets against the manifest, then run the [inventory acceptance matrix](/docs/troubleshooting/inventory-updates#manual-acceptance-matrix). Starting the resource is not proof that saved items survive reconnect.

## Configuration Overview

The referenced [config.lua](https://github.com/loljoshie/lj-inventory/blob/86ec0d8425cdc980c4dc4541841deb381f24e1e5/config.lua) defines `Config.MaxInventoryWeight`, `Config.MaxInventorySlots`, `Config.CleanupDropTime` and `Config.UseItemDrop`. `Config.UseTarget` reads the `UseTarget` convar. Inspect that file for your actual settings rather than assuming a separate crafting config or a compatibility toggle exists.

The [config validator](/tools/config-validator) provides supported static diagnostics. It does not validate all LJ-specific options or certify runtime compatibility.

## Migration Tips

### Match APIs before renaming resources

At this LJ revision, [server/main.lua](https://github.com/loljoshie/lj-inventory/blob/86ec0d8425cdc980c4dc4541841deb381f24e1e5/server/main.lua) registers `inventory:server:OpenInventory` as a network event and does not define an `OpenInventory` export. Current upstream callers using the server `OpenInventory(source, identifier, data)` export therefore require an actual migration, not a resource-name substitution.

Do not recreate unrestricted client-controlled stash access as a compatibility fix. Use server-owned identifiers and authorization appropriate to the stash. The [inventory update guide](/docs/troubleshooting/inventory-updates#replace-an-old-stash-caller-without-exposing-every-stash) shows a constrained upstream integration.

### Match schemas before importing SQL

The LJ [schema](https://github.com/loljoshie/lj-inventory/blob/86ec0d8425cdc980c4dc4541841deb381f24e1e5/qb-inventory.sql) includes `stashitems`, `trunkitems` and `gloveboxitems`, as well as a `player_vehicles` definition. It is not a migration into the current upstream `inventories` table. `CREATE TABLE IF NOT EXISTS` also does not update a pre-existing table's columns.

When moving to upstream `qb-inventory`, review the exact target commit's migration and identifier prefixes against a staging restore. Check row counts and contents for each storage type, then verify persistence after reconnect. Follow [non-player storage migration guidance](/docs/troubleshooting/inventory-updates#separate-player-inventory-from-non-player-storage), including its non-idempotent SQL warning and rollback procedure.

## See Also

- [Inventory systems](/resources/inventory): compare sources and migration requirements.
- [QBCore inventory](/docs/resources/qb-inventory): upstream APIs.
- [Resource compatibility checklist](/docs/migration/tools/compatibility-checker): static and runtime review.

## Troubleshooting

| Issue | First diagnostic |
| --- | --- |
| `No such export OpenInventory` | Check the provider revision and calling side; LJ's referenced implementation uses a legacy event. |
| Stashes empty after switching inventory | Compare old/new tables and identifiers before changing or rerunning SQL. |
| UI not loading or misaligned | Inspect `html/ui.html`, `html/css/main.css` and failed requests in NUI DevTools. `lj-inventory/html` contains source assets: do not delete it as a cache. |
| Items missing after reconnect | Compare shared item definitions, save errors and persisted data against the backup. |
| Weight or item operations fail | Inspect the actual export signature and return value, then test capacity rejection on staging. |

## Additional Resources

- [Pinned LJ source and README](https://github.com/loljoshie/lj-inventory/tree/86ec0d8425cdc980c4dc4541841deb381f24e1e5).
- [Current upstream qb-inventory](https://github.com/qbcore-framework/qb-inventory): evaluate its source independently before migrating.
- [Inventory troubleshooting](/docs/troubleshooting/inventory-updates): evidence collection, API differences and acceptance tests.
