API for mods that want more in depth options for loot bags.
THIS (AND MY OTHER MODS) WILL NOT GET UPDATED ANYMORE ON ACCOUNT ME (JustNU) LEAVING THE SPT-AKI COMMUNITY
ALL OF MY MODS ARE UNLICENCE AKA PUBLIC DOMAIN, SO ANYONE WHO WISHES TO UPDATE/IMPROVE/TAKE OVER THE DEVELOPMENT IS FREE TO DO SO
I HAVE ALSO UPDATED SOURCE ENTRY FOR EVERY MOD OF MINE, IN CASE YOU WANT THE GITHUB REPOS
Replaces default “openRandomLootContainer” function to allow for more in depth customization of loot bag/container loot and its amount. For an example of this mod in action, take a look at this mod.
You need to load your loot bag loot info into AKI’s inventory config under randomLootContainer, DO IT VIA MODS ONLY, TAKE A LOOK AT MOD EXAMPLES IF YOU DON’T KNOW HOW
Don’t forget to make sure your loot bag item has random container parent ID in the item database
customReward entry is required and should always be true
You can have multiple loot pools with different set of loot that you can receive in a single loot bag
nValue is a rarity system, with 1 being fully random and values higher making valuable loot rarer
it also has a demo you can play around with
In the image showed above, opening the loot bag will give
0-2 of items from loot pool 1,
1-2 of items from loot pool 2,
2-10 items from loot pool 3
at the same time, resulting in 3-14 items total
795 Downloads
Released Aug 8, 2023 at 4:31 PM
Fika Compatibility Unknown- Updated codebase to work with 3.6.X
1.4K Downloads
Released Oct 11, 2023 at 9:49 PM
Fika Compatibility Unknown- Updated akiVersion to 3.7.X
268 Downloads
Released Feb 10, 2023 at 6:03 AM
Fika Compatibility Unknown1.6K Downloads
Released Feb 13, 2023 at 7:42 AM
Fika Compatibility Unknown- Updated akiVersion to 3.5.X
No Addons Yet
This mod doesn't have any addons yet.
Details
-
GUID
Not Available
-
License
-
Source Code
-
Fika Compatibility Unknown

https://prnt.sc/MYWFuySSd1R1 i dont understand ??
oh i am using 3.5.5
TypeError: Cannot read properties of undefined (reading ‘getItems’)
TypeError: Cannot read properties of undefined (reading ‘getItems’)
at Function.customOpenRandomLootContainer (I:\New folder (4)\user\mods\EnhancedLootBagsAPI\src\mod.js:26:46)
at InventoryCallbacks.result.openRandomLootContainer (I:\New folder (4)\user\mods\EnhancedLootBagsAPI\src\mod.js:14:16)
at InventoryItemEventRouter.handleItemEvent (C:\snapshot\project\obj\routers\item_events\InventoryItemEventRouter.js)
at ItemEventRouter.handleEvents (C:\snapshot\project\obj\routers\ItemEventRouter.js)
at ItemEventCallbacks.handleEvents (C:\snapshot\project\obj\callbacks\ItemEventCallbacks.js)
at RouteAction.action (C:\snapshot\project\obj\routers\static\ItemEventStaticRouter.js)
at ItemEventStaticRouter.handleStatic (C:\snapshot\project\obj\di\Router.js)
at HttpRouter.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)
at HttpRouter.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)
at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)
TypeError: Cannot read properties of undefined (reading ‘getItems’)
TypeError: Cannot read properties of undefined (reading ‘getItems’)
at Function.customOpenRandomLootContainer (I:\New folder (4)\user\mods\EnhancedLootBagsAPI\src\mod.js:26:46)
at InventoryCallbacks.result.openRandomLootContainer (I:\New folder (4)\user\mods\EnhancedLootBagsAPI\src\mod.js:14:16)
at InventoryItemEventRouter.handleItemEvent (C:\snapshot\project\obj\routers\item_events\InventoryItemEventRouter.js)
at ItemEventRouter.handleEvents (C:\snapshot\project\obj\routers\ItemEventRouter.js)
at ItemEventCallbacks.handleEvents (C:\snapshot\project\obj\callbacks\ItemEventCallbacks.js)
at RouteAction.action (C:\snapshot\project\obj\routers\static\ItemEventStaticRouter.js)
at ItemEventStaticRouter.handleStatic (C:\snapshot\project\obj\di\Router.js)
at HttpRouter.handleRoute (C:\snapshot\project\obj\routers\HttpRouter.js)
at HttpRouter.getResponse (C:\snapshot\project\obj\routers\HttpRouter.js)
at AkiHttpListener.getResponse (C:\snapshot\project\obj\servers\http\AkiHttpListener.js)
Doesn’t appear to be working after 3.5.7+
This will be insane once devs start utilizing this