API Reference
Public exports and events for BJJ Loot Pool v1 integration
Server Exports
BJJ Loot Pool operates server-side only. All exports below are server-side functions.
Exports
| Export | Parameters | Returns | Description |
|---|---|---|---|
createLootPool(data) | data: table | string | Creates a new loot pool. Returns pool ID. |
addLootToPool(poolId, loot) | poolId: string, loot: table | boolean | Adds loot to a pool. |
removeLootFromPool(poolId, lootId) | poolId: string, lootId: string | boolean | Removes loot from a pool. |
spawnDrop(data) | data: table | string | Spawns a loot drop in the world. Returns drop ID. |
removeDrop(dropId) | dropId: string | boolean | Removes a loot drop by ID. |
Parameter Details
createLootPool
data: table with the following fields:name:string— Pool nameitems:table— Array of item tables (see below)rarity:string— Rarity label (optional)meta:table— Any additional metadata (optional)
addLootToPool / removeLootFromPool
poolId: Pool ID (string)loot: Loot table (see below)lootId: Loot ID (string)
spawnDrop
data: table with the following fields:poolId:string— Loot pool to usecoords:vector3— World coordinatesmeta:table— Any additional metadata (optional)
removeDrop
dropId: Drop ID (string)
Example Data Structure
{
name = 'police_safe',
items = {
{ name = 'money', count = 1000, chance = 0.5 },
{ name = 'weapon_pistol', count = 1, chance = 0.1 }
},
rarity = 'rare',
meta = { zone = 'bank' }
}Events
| Event | Parameters | Description |
|---|---|---|
bjj_lootpool:client:dropSpawned | dropId: string, meta: table | Fired when a loot drop is spawned |
bjj_lootpool:client:dropPickedUp | dropId: string, meta: table | Fired when a loot drop is picked up |
bjj_lootpool:client:poolCreated | poolId: string, meta: table | Fired when a loot pool is created |
Example Usage
-- Create a loot pool
local poolId = exports['bjj_lootpool']:createLootPool({
name = 'police_safe',
items = {
{ name = 'money', count = 1000, chance = 0.5 },
{ name = 'weapon_pistol', count = 1, chance = 0.1 }
},
rarity = 'rare',
meta = { zone = 'bank' }
})
-- Spawn a drop from the pool
local dropId = exports['bjj_lootpool']:spawnDrop({
poolId = poolId,
coords = vector3(250.0, 220.0, 100.0)
})
-- Listen for drop pickup
RegisterNetEvent('bjj_lootpool:client:dropPickedUp', function(dropId, meta)
print('Drop picked up:', dropId, meta)
end)System Overview
BJJ Loot Pool is a server-side only system that manages dynamic loot spawning and distribution.
- All API calls are made from server-side scripts only
- Loot drops are managed entirely server-side for security
- Client receives updates via statebags and events only
This resource has no client-side exports or functions. All integration happens server-side.
For advanced use cases, contact the development team for guidance on safe integration.
BJJ Loot Pool
BJJ Loot Pool is a modular, closed-source loot and drop management framework for FiveM. It provides public APIs and event hooks for creating, distributing, and managing loot pools and drops, while keeping internal logic secure.
Core Introduction
High-level overview of the BJJ Racing Core system and its modular components.