-
Notifications
You must be signed in to change notification settings - Fork 0
Addon Override API
Dasik (Rifaditya) edited this page Aug 9, 2026
·
1 revision
Stack Size Adjuster provides an internal extension mechanism via StackSizeManager.registerOverride. Third-party mods and collection addons (e.g. Potion Stacker Addon, Stew Stacker Addon) can register item-specific or category-specific override functions to bypass global GameRule category limits.
package net.instantgratification.stacksizeadjuster.util;
import net.minecraft.world.item.Item;
import java.util.function.BiFunction;
public class StackSizeManager {
public static void registerOverride(BiFunction<Item, Integer, Integer> override);
}-
Item: The targetIteminstance being checked. -
Integer: The original natural stack size of the item. -
Integer(Return Value): The modified stack size limit (or original value if unhandled).
Below is an example of how an addon mod registers custom stack sizes for specific item types:
import net.instantgratification.stacksizeadjuster.util.StackSizeManager;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.PotionItem;
public class CustomAddonInitializer implements ModInitializer {
@Override
public void onInitialize() {
StackSizeManager.registerOverride((item, originalSize) -> {
// Allow potions to stack up to 16 regardless of global 1-stack limit
if (item instanceof PotionItem) {
return 16;
}
// Allow Ender Pearls to stack up to 64
if (item == Items.ENDER_PEARL) {
return 64;
}
// Return original size to delegate back to global GameRule limits
return originalSize;
});
}
}- If an override function returns a value different from
originalSize, that modified value is returned immediately. - If no overrides change the stack size,
StackSizeManagerfalls back to checking the active world GameRules (items_64_limit,items_16_limit, oritems_1_limit).
๐ Repository Source Disclaimer: The documentation in this Wiki reflects the current source code state in the repository, which may include recent unreleased commits or developmental features ahead of public release builds on CurseForge and Modrinth.
Copyright ยฉ 2026 Dasik (Rifaditya). Licensed under the GNU General Public License v3.0 (GPLv3).
๐ Home
- Dynamic GameRules
- Category Stack Limits
- Container Drop Optim.
- Large Chest Overflow
- ModMenu & YACL Config
- Item Count Rendering
- Item Clumps Synergies
- Troubleshooting & FAQ
- Developer Setup
- Architecture Layout
- Mixin Reference
- Addon Override API
- Network Sync Protocol
- Give Command Handling
- Behavior Profiles
- Consumer Mods Guide
- Performance Impact
- Advancements Matrix
- Author: Dasik (Rifaditya)
- License: GPL-3.0-or-later