Page 1 of 1

Override item stack size with stack.override_count()

Posted: Sat Oct 12, 2024 11:37 pm
by protocol_1903
I would like to be able to override the stack size of an item using scripting. Stacks over a normal stack size is already a "feature", in how updating mods/versions can decrease a stack size, but already existing stacks are unaffected. It would be useful and convenient to open this feature to scripting.

Currently, LuaItemStack.count() sets the item stack amount equal to the amount parameter or the item stack size, whichever is lower. Therefore, it is impossible to obtain "overstacked" stacks, even through scripting.

I would like LuaItemStack.count() to accept a "override_stack_size" parameter, or a new method along the lines of LuaItemStack.override_count() that does not check if the input count is greater than the item stack size.

example of normal item stack next to overstacked item stack
Screenshot 2024-10-12 162927.png
Screenshot 2024-10-12 162927.png (24.14 KiB) Viewed 403 times

Re: Override item stack size with stack.override_count()

Posted: Sat Dec 28, 2024 2:25 am
by protocol_1903
Bringing to the front for 2.0 consideration, I don't see why this would cause many issues in the current engine. Please and thank you

Re: Override item stack size with stack.override_count()

Posted: Sat Dec 28, 2024 2:33 am
by protocol_1903
Additionally, I think it should be possible to obtain these overstacked item stacks somehow. Some even partially hacky way to obtain them with scripting.