Skip to main content

Overview

AutoReplenish automatically refills items in your hotbar when they run low or run out. It maintains your hotbar layout by restacking items and replacing empty slots with matching items from your inventory.

Features

  • Two operating modes: percentage-based and slot-memory
  • Configurable refill delay to avoid detection
  • Smart item matching by name and type
  • Automatic stack merging
  • Works with inventory screens

Settings

Percent
number
default:"32"
Percentage threshold for refilling items (0-100)
  • 0: Memory mode - remembers what was in each slot
  • 1-100: Refills when item count drops below this percentage
Delay
number
default:"200"
Delay between refill actions in milliseconds (0-500ms)Higher delays are safer for anti-cheat but slower to refill

Operating Modes

How It Works

When Percent is set to 1-100:
  1. Monitors all hotbar slots continuously
  2. When an item drops below the threshold percentage
  3. Searches inventory for matching items
  4. Merges stacks to refill the hotbar slot

Best For

  • Building with blocks
  • Eating food
  • Throwing projectiles
  • Any stackable items

Example

Percent: 32 (32% threshold)
Hotbar Slot 1: 20/64 Cobblestone (31.25%)
→ Triggers refill from inventory
→ Merges with inventory stack
→ Result: 64/64 Cobblestone

Configuration Guide

1

Choose Your Mode

  • Set Percent to 0 for memory mode
  • Set Percent to 5-50 for percentage mode (recommended: 32)
2

Adjust Delay

  • Low delay (50-100ms): Fast but detectable
  • Medium delay (200-300ms): Balanced (recommended)
  • High delay (400-500ms): Safe but slower
3

Test It Out

Place items in your hotbar and use them to see the refill behavior

Technical Details

Memory Mode Logic

// Located at: misc/AutoReplenish.java:51-98
if (percent.getValue().intValue() == 0) {
    // Cache current hotbar state when in inventory
    if (mc.currentScreen != null) {
        for (int i = 0; i < 9; i++) {
            cache[i] = mc.player.getInventory().getStack(i).getItem();
        }
        return;
    }
    
    // Refill empty slots with cached items
    if (timer.isPassed()) {
        for (Item item : cache) {
            if (item != null && !item.equals(Items.AIR)) {
                if (mc.player.getInventory().getStack(index).isEmpty()) {
                    int slot = getSlot(item);
                    if (slot != -1) {
                        InventoryUtils.moveItem(slot, index);
                        timer.resetDelay();
                        return;
                    }
                }
            }
            index++;
        }
    }
}

Percentage Mode Logic

// Located at: misc/AutoReplenish.java:98-118
if (timer.isPassed()) {
    for (int i = 0; i < 9; i++) {
        ItemStack stack = mc.player.getInventory().getStack(i);
        if (stack.isEmpty() || !stack.isStackable()) continue;
        
        double stackPercent = ((float) stack.getCount() / stack.getMaxCount()) * 100.0f;
        if (stack.getCount() == 1 || stackPercent <= Math.max(percent.getValue().floatValue(), 5.0f)) {
            if (replenishStack(stack, i)) return;
        }
    }
}

Usage Examples

Setup:
- Percent: 32
- Delay: 200
- Hotbar: 64 Stone in Slot 1
- Inventory: 5 stacks of Stone

Behavior:
1. Place blocks until stack reaches 20/64 (31%)
2. AutoReplenish triggers
3. Merges with inventory stack
4. Back to 64/64, continue building

Smart Item Matching

AutoReplenish uses multiple checks to ensure correct item matching:
Compares item display names to ensure exact matches
if (!stack.getName().equals(item.getName())) continue;
For blocks, verifies the block type matches
if (stack.getItem() instanceof BlockItem blockItem && 
    blockItem.getBlock() != blockItem1.getBlock()) continue;
Final verification that item types match
if (stack.getItem() != item.getItem()) continue;

Best Practices

Organize Inventory

Keep multiple stacks of frequently used items in your inventory for seamless refilling

Use Memory Mode for PvP

Memory mode (Percent: 0) maintains consistent hotbar layout crucial for muscle memory

Adjust Delay for Server

Increase delay on strict anti-cheat servers to avoid detection

Test Before Combat

Test your configuration in a safe area before entering combat situations

Compatibility Notes

Works while inventory screen is open (Percentage Mode)
Compatible with all stackable items
Supports custom item names and NBT data
May not work with some inventory management mods
Some servers may detect rapid inventory clicks
  • AutoTool: Automatically switches to the best tool
  • MiddleClick: Quick inventory management with middle mouse
  • XCarry: Extended crafting grid inventory

Build docs developers (and LLMs) love