Skip to main content

Overview

AutoTool automatically switches your hotbar to the most efficient tool when breaking blocks. It detects which block you’re mining and selects the appropriate tool from your hotbar.

Features

  • Automatic tool selection based on block type
  • Syncs with server to prevent desync
  • Works with all vanilla and modded tools
  • Respects block hardness calculations

How It Works

1

Block Detection

When you start breaking a block, AutoTool detects the block type and state
2

Tool Analysis

Scans your hotbar for all available tools and calculates mining speed for each
3

Automatic Switch

Switches to the slot with the most efficient tool
4

Server Sync

Syncs the slot change with the server to prevent desync issues

Configuration

This module has no additional settings - it works automatically when enabled.

Technical Details

Source Reference

// Located at: misc/AutoTool.java:22-38
@SubscribeEvent
public void onBreakBlock(LivingEvent.AttackBlock event) {
    BlockState state = event.getState();
    
    if (state.getBlock() != Blocks.AIR && MineUtils.canBreak(event.getPos())) {
        int slot = InventoryUtils.getBestToolSlot(state.getBlock());
        if (slot != -1 && mc.player.getInventory().selectedSlot != slot) {
            mc.player.getInventory().selectedSlot = slot;
            ((IClientPlayerInteractionManager) mc.interactionManager).doSyncSelectedSlot();
        }
    }
}

Tool Selection Algorithm

The module uses InventoryUtils.getBestToolSlot() which:
  1. Checks all 9 hotbar slots
  2. Calculates mining speed multipliers for each tool
  3. Considers enchantments (Efficiency, etc.)
  4. Returns the slot with the fastest mining speed

Usage Examples

1. Enable AutoTool
2. Have multiple tools in hotbar:
   - Diamond Pickaxe (Slot 1)
   - Diamond Axe (Slot 2)
   - Diamond Shovel (Slot 3)
3. Mine stone -> Auto switches to pickaxe
4. Mine wood -> Auto switches to axe
5. Mine dirt -> Auto switches to shovel

Best Practices

Tool Organization

Keep your tools in consistent hotbar slots for muscle memory

Backup Tools

Carry backup tools in case one breaks

Enchantments

Use Efficiency enchantments for maximum benefit

Durability

Monitor tool durability to avoid breaking mid-mine

Compatibility

  • All vanilla tools
  • Most modded tools
  • Custom block types
  • All game modes
Some servers may flag rapid tool switching as suspicious. Use with caution on strict anti-cheat servers.
  • AutoReplenish: Automatically refills broken tools
  • Nuker: Mass block breaking with automatic tool selection

Build docs developers (and LLMs) love