Project Zomboid

Project Zomboid

101 ratings
JB Max Capacity Override
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
571.026 KB
25 Mar @ 4:36pm
15 Oct @ 9:36am
14 Change Notes ( view )

Subscribe to download
JB Max Capacity Override

Description
Pure Lua Max Capacity Override (v1.1)
Now with 98.355% less jank!
Compatible ONLY with Build 42 — does NOT work with Build 41.



If you're here from Customizable Containers
That mod uses a custom implementation of JB Max Capacity Override.
On it's own, JB Max Capacity Override works fine on 42.12



Dear Players, I've added some patches for CC, SOTO and True Smoking but in the end, we're all trying to muck with the same core functions. This means that this mod may not work as expected when any of those mods are active.

Dear Modders, I've added a late load to my functions that defers to the mods above if they're active. If I'm stepping on your toes, let me know and I'll get a patch in here to play nice.



Requires Starlit Library by albion for correct tooltip capacity display.
Regarding the "require=\StarlitLibrary" line in the mod.info: As of Build 42, the backslash is required. https://pzwiki.net/wiki/Mod.info



This mod does nothing on its own. It’s intended for your friendly neighborhood modder.



Summary
This mod provides a pure Lua MAX_CAPACITY override without needing any Java mod installations. It works on:
  • "Equipable" Bags
  • Crates / Containers
  • Truck beds / Trunks
  • Sprite containers (with some limitations)



07/31/25
Re-added mod data override for single containers. Example usage:
yourContainer:getModData()["JB_MaxCapacityOverride"] = { capacity = 75 }

- Works if the container type exists in the lookup table
- Compatible with bags and sprite containers
- Mod data override not yet compatible with trunks (WIP)



Current To-Do List
  • [ ] Add equipped weight override
  • [ ] Handle right-click grab bug
  • [ ] Consider player inventory capacity override (probably not)
  • [ ] Fix transfer times for heavy items in world context (borked right now)



Side note: The World Object Context Menu can eat me.



Performance Boost
Includes Nepenthe's speed fix from Remove Bag Slowdown (used with permission).

Drop some likes and awards on Nepenthe’s workshop:
https://gtm.steamproxy.vip/id/drstalker/myworkshopfiles/

This fix does NOT bypass the “Heavy Load” moodle slowdown.



Argument Structure (for addContainer)
("type", capacity, preventNesting, _equippedWeight, _transferTimeSpeed)

type | string | Container type (use getType() to find it)
capacity | number | Max weight container can hold
preventNesting | boolean | Prevents nesting same type containers
_equippedWeight | number | (optional) Weight of equipped container
_transferTimeSpeed | number | (optional) Transfer time override

Error checking included for capacity and preventNesting.
Equipped weight and transfer speed are optional — defaults to nil.

How To Use
[ ] Create a new Lua file
[ ] Add and customize the following code:

local JB_MaxCapacityOverride = require("JB_MaxCapacityOverride")

JB_MaxCapacityOverride.addContainer("Bag_ShotgunDblSawnoffBag", 125, true, nil, 30)
JB_MaxCapacityOverride.addContainer("militarycrate", 180, true)
JB_MaxCapacityOverride.addContainer("TruckBedOpen", 500, false)

[ ] Add to your mod.info: require=\JB_MaxCapacityOverride

[ ] Upload to the workshop



Found a bug? No you didn't. Really? Aight, report it here please:
https://github.com/mikej1977/JB_MaxCapacityOverride




Workshop ID: 3452113500
Mod ID: JB_MaxCapacityOverride
Popular Discussions View All (1)
15
9 Sep @ 9:49am
Players Inventory
Flexible Games
113 Comments
jbdiablo  [author] 12 hours ago 
added patches for CC, SOTO and True Smoking to defer to whichever function won the loading war

and a side note that if you have any combination of the above enabled, you will probably get some errors and/or unexpected behavior
jbdiablo  [author] 13 hours ago 
@明明灭灭 - there may be more going on but I'll add a patch for TrueSmoking since it's nuking the same functions as I am. The 42.12 update mucked a lot of stuff up.

@gravelle164 - correct, it just changes a whole bunch of lua functions. You'll need to add a container to the lookup table for it to do anything useful.
gravelle164 16 hours ago 
im assuming from what im reading this mod doesnt do anything on its own correct?
明明灭灭 17 hours ago 
Perhaps it's caused by a series of mod conflicts. I've been using this mod recently, and it causes errors when used together with previously added mods.
明明灭灭 17 hours ago 
`Callframe at: isExclusive
function: SetClothingInfo -- file: ItemInfo.lua line # 459 | MOD: More Item Information
function: SetItemInfo -- file: ItemInfo.lua line # 130 | MOD: More Item Information
function: render -- file: ItemInfo.lua line # 733 | MOD: More Item Information
function: render -- file: AAA_show_material.lua line # 75 | MOD: 界面:展示布料信息 Show Clothes Material
function: render -- file: KATTAJ1_TooltipFixer.lua line # 13 | MOD: KATTAJ1 Clothes Core
function: render -- file: Skill Recovery Journal Tooltip.lua line # 296 | MOD: Skill Recovery Journal

`
明明灭灭 17 hours ago 
This comment is awaiting analysis by our automated content check system. It will be temporarily hidden until we verify that it does not contain harmful content (e.g. links to websites that attempt to steal information).
明明灭灭 17 hours ago 
`function: getOverrideType -- file: JB_MaxCapacityOverride.lua line # 312 | MOD: JB Max Capacity Override
function: new -- file: JB_MaxCapacityOverride.lua line # 315 | MOD: JB Max Capacity Override
function: ReturnItemToContainer -- file: ISCraftingUI.lua line # 2016 | Vanilla
function: eatItem -- file: ISInventoryPaneContextMenu.lua line # 4122 | MOD: Give Me Some Time
function: eatItem -- file: TrueSmoking.lua line # 301 | MOD: True Smoking
function: findSmokable -- file: TrueSmoking.lua line # 291 | MOD: True Smoking
function: onKeyStartPressed -- file: TrueSmoking.lua line # 339 | MOD: True Smoking
function: keyWrapper -- file: TrueSmoking.lua line # 397 | MOD: True Smoking
java.lang.RuntimeException: attempted index: getType of non-table: null
at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1530)
at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:502)
at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:174)
jbdiablo  [author] 14 Oct @ 6:42pm 
@Gentoo - Yo, thanks for the heads up! I'll get a fix in here in a day or two.
Gentoo 14 Oct @ 3:37pm 
The Dexterous trait conflicts with the SOTO mod.

Just a warning.
魔法 5 Oct @ 6:50pm 
大佬我改好了,我本地吧代码改了,谢谢大佬给代码,不报错了