Configure the stack size of any in-game item via an editable config file. The 63-stack size limit is removed in Singleplayer but remains in Multiplayer. By default:
- Stackable "smallitems" have a stack size of 64 (32 in player inventory).
- Items like O2/fuel tanks remain unstackable in player inventory but stack to 64 elsewhere.
- Ammo and battery stacks are doubled in player inventory (e.g., 24 revolver rounds instead of 12).
All defaults are customizable in the config file.
- Lua For Barotrauma with "CSharp Scripting" enabled.
Launch the game once with the mod enabled to generate the default config in the Barotrauma/WorkshopMods/Installed/3402019765/
directory. "Barotrauma" refers to the folder where your save files are stored.
In Multiplayer, only the host’s configuration is used and synced to players.
"itemPatches": [
{
"applyOnlyToStackables": false,
"tags": [ "mobilebattery", "handheldammo" ],
"operations": [
{ "key": "MaxStackSize", "operation": "=", "value": "{maxStackSize}" },
{ "key": "MaxStackSizeCharacterInventory", "operation": "*", "value": 2 },
]
}
],
"containerOptions": {
"maxStackSize": 64,
"characterInventoryCapacity": 32,
}
The configuration uses itemPatches
to define stack size rules based on tags or item IDs. Items are matched in top-down order, applying the operations of the first matching patch.
Each item has three stack sizes: general, player inventory, and mobile containers. Operations modify these sizes using numbers or references to container options like {maxStackSize}
.
The containerOptions
section sets general stack size limits for different container types. For example, maxStackSize
applies to containers that don't fall under other specific container groups. Customize these limits as needed in the config file.
If applyOnlyToStackables
is not specified, it defaults to true.
Refer to the config file for more details.