umarfarooq112233

make a clint side mod that automate player to automaticaly go for mining and mine specifically selected ored or other block and add a key bing to on off mod and add another keybind to open menu to selecte block and ammount

Kodari AI
KodariOct 14 at 9:59 am 19
AutoMinerAssistant
Client-side Minecraft Fabric mod that automates player mining. Features a keybind to toggle the automation on/off and a second keybind to open a configuration menu. The menu allows selecting specific ores or blocks to mine and setting a target quantity. When enabled, the mod automatically navigates the player to nearby selected blocks, mines them, and collects drops until the target amount is reached. Includes visual indicators for active state and progress tracking.

Plan:

  1. Build setup: Gradle, fabric.mod.json, manifest.kod (owo-lib), lang file.

  2. Keybinds: toggle key for auto-mining on/off, and a key to open the selection menu.

  3. Mining automation: scan for selected blocks, walk to them, and break them until the target amount is reached.

  4. Selection menu: owo-ui screen to pick block types and the amount.

I’m checking the owo-ui doc and the Fabric and vanilla signatures before writing any Java.

Plan:

  1. Build files: gradle.properties, build.gradle, manifest.kod, fabric.mod.json, en_us.json.

  2. Keybinds: toggle the auto-miner with one key and open the selection menu with another.

  3. Auto-miner: scan for selected blocks, path to them, dig through obstacles, and mine until the amount is reached.

  4. Selection menu: an owo-ui screen to choose blocks and the amount.

Before writing the mining logic I need to confirm a few more signatures.

Lookups are done. Creating the project files now: build setup, client entrypoint with keybinds, config, pathfinder, miner state machine, and the owo-ui selection screen.

The auto-miner mod is written. I haven’t compiled it yet, so expect the first build to surface small issues.

What it does

  • G toggles auto-mining on and off. M opens the block selection menu. Both keys can be rebound under Controls, in the “Auto Miner” category.

  • Selection menu: a searchable list of blocks with checkboxes, an amount box, and Clear and Done buttons. Your selection and amount are saved to config/automine.txt.

  • Amount: the number of selected blocks to mine before it stops automatically.

  • Mining: the bot scans about 20 blocks around you, walks to the nearest selected block, and mines it. If the route is blocked, it digs through the obstacle. It avoids lava and water.

  • Pausing: it pauses whenever any screen is open and resumes when you close it.

Files: src/client/java/com/example/automine/client/ holds AutoMineClient, AutoMiner, PathFinder, AutoMineConfig, and AutoMineScreen. The build files, fabric.mod.json, manifest.kod (owo-lib), and en_us.json are alongside.

To get the jar: click Compile in the top bar, then Compile in the window that opens. When it succeeds, click Download.

Limitations to know about

  • It mines by reach (about 4 blocks) and doesn’t check line of sight. On multiplayer servers with anti-cheat, this may get flagged.

  • Pathfinding only searches a limited box around you. If the selected blocks are far away, it reports that no blocks were found nearby.

  • Walking and digging are tuned by constants in AutoMiner and PathFinder, so they may need adjusting after you test.

umarfarooq112233

it should mine way to mine blocks

Kodari AI
KodariOct 14 at 10:13 am 2

I’ll check the current miner and pathfinder code first, since the tunneling logic lives there.

The read shows the real cause. Before I edit anything, I need to confirm the vanilla signatures these files call.All the signatures the files use match the source. The root cause is in the pathfinder. Digging costs 4 per block, but the A* heuristic counts only 1 per block of distance, so the search explores far more than 6000 nodes for any ore behind stone. It then returns no path, and the bot blacklists that ore. I’ll make the search weighted so it digs straight toward the target, and stop the bot at each path node so it doesn’t overshoot into walls at corners.

The auto-miner now digs a tunnel toward the selected block when the way is blocked by stone or other solid blocks.

  • Pathfinding: the search was giving up on any ore behind stone and skipping it. It now searches with a stronger heuristic and a larger search budget, so it finds routes that dig through solid blocks.

  • Movement: the bot stops at each path point before turning. Before, it kept walking forward and could slide into walls at corners of a tunnel.

I haven’t compiled or tested this in game. Click Compile in the top bar, then Compile in the window that opens, and click Download when it succeeds. If you see a path that still gets stuck, tell me where it happens and I’ll tune it.

umarfarooq112233

it should also pickup block/items that is mined/breaked

Kodari AI
KodariOct 14 at 10:18 am 3

Pickup needs a path that ends on the item’s cell, which the current pathfinder doesn’t support, so I’ll add that mode to it and then wire in the item collection.

The pathfinder patch was rejected, and the miner patch left the old path-following block in tick(), so it still calls the old signatures. Fixing both now.

Both patches applied. Checking for leftover references to the removed giveUpPath and to the old find signature.

The auto-miner now walks over and picks up items that drop from mined blocks.

  • Collecting: after each break, the bot looks for dropped items within about 8 blocks horizontally and 4 vertically, walks onto the nearest one, and stands on it until the server picks it up.

  • Priority: pickup runs before the next block is targeted, so drops don’t get left behind.

  • Finishing: when the target amount is reached, the bot collects the remaining drops before it stops.

  • Give-up: an item that can’t be reached, or that stays uncollected for about 6 seconds (for example, when the inventory is full), is skipped.

Items you drop yourself within that radius will also be collected while the miner is on. I haven’t compiled or tested this in game. Click Compile in the top bar, then Compile in the window that opens, and click Download when it succeeds. If it stops to pick up something it shouldn’t, or misses drops, tell me where and I’ll adjust the radius and timeout.

umarfarooq112233

there is no stone in M menu

Kodari AI
KodariOct 14 at 10:25 am 1

The cause is the 200-row cap in rebuildList. The list is sorted alphabetically, and “Stone” falls past row 200 because there are over a thousand blocks, so it gets cut off. I’ll remove the cap so every block is listed, and the search box still narrows the list.

Stone now appears in the M menu. The list was capped at 200 rows and sorted alphabetically, so “Stone” was cut off. I removed the cap, so every block shows up. Type in the search box to narrow the list (for example, “stone”).

I haven’t compiled or tested this in game. Click Compile in the top bar, then Compile in the window that opens, and click Download when it succeeds. With all blocks listed, the menu may take a moment to open or refresh the list on each keystroke. If it feels slow, tell me and I’ll limit the list to blocks you can actually mine.

umarfarooq112233

some time it is not mining block infront him example he is not correctly mining stone blocks to reace coal ore

Kodari AI
KodariOct 14 at 10:30 am 3

I’ll read the miner and pathfinder to find why it skips blocks in front of it.

The code shows two causes. First, the bot can stand in range of coal with stone between them and “mine” the coal through the stone, so the stone in front never gets dug. Second, when it turns a corner in a tunnel, its body can press against a stone wall that isn’t on the path, and it never digs that wall. Before I change anything, I’ll confirm the raycast APIs I need.Both APIs are confirmed. The fix has three parts:

  • Sight check: when the bot is in reach of its target but a solid block is between them, it mines that block first.

  • Wall digging: if the bot makes no progress for about 1.25 seconds, it mines the solid block pressing against it.

  • Dig-cell helper: PathFinder gets a helper that says whether a cell can be dug.

The patch reported success for AutoMiner.java, but the file list didn’t include PathFinder.java. I’ll confirm the helper landed.

The PathFinder helper didn’t land, so AutoMiner now calls a method that doesn’t exist. I’ll add it now.

The bot now mines the stone between it and the target, and it digs through walls when a corner pins it.

  • Stone between bot and target: it could reach coal through solid stone, so it broke the coal while the stone in front stayed. Before breaking a target, it now checks the line of sight and mines the first solid block in the way.

  • Corners and walls: when the bot makes no progress for about 1.25 seconds, it mines the solid block pressing against it. Blocks behind it are skipped.

  • Unbreakable blocks: if a blocking block can’t be broken, the target is skipped so the bot doesn’t loop forever.

I haven’t compiled or tested this in game. Click Compile in the top bar, then Compile in the window that opens, and click Download when it succeeds.

The bot doesn’t switch to a pickaxe, so hold a pickaxe in your hotbar while it runs. Without one, stone and coal take much longer to break and coal may not drop. If it still skips a block, tell me where it happens.

umarfarooq112233

make it behave like player and place block when needed dont die in lave or with mobs and make it movement like realplayer

Kodari AI
KodariOct 15 at 3:25 am 3
  1. Improve movement so the miner navigates and turns more like a player.

  2. Place blocks when needed to cross gaps or avoid falls.

  3. Detect lava and hostile mobs and retreat or stop before dying.

  1. Movement: added gradual turning and stops forward input during large turns and near path nodes.

  2. Next: inspect pathing and placement APIs to add safe bridging over gaps.

  3. Then: add lava/mob danger checks and retreat behavior.

  1. Bridging: added one-block gap paths and placement from the held item or hotbar; it waits for placement confirmation and restores the selected slot.

  2. Now adding lava and hostile-mob safety checks, with evasive movement rather than continuing the mining route.

Updated the auto-miner to turn gradually, stop before overshooting path nodes, and sprint away from nearby lava or hostile mobs. It now looks for a safe adjacent step before fleeing; if none is available, it stops rather than continuing to mine.

It can also bridge a single-block gap when there’s solid ground beyond it. Keep placeable blocks in your hotbar or offhand; if it can’t place a bridge, it stops. I haven’t tested this in game.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
Code
10 1,244
src/client/java/com/example/automine/client/AutoMineClient.java
package com.example.automine.client;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.Identifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AutoMineClient implements ClientModInitializer {
    public static final String MOD_ID = "automine";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    private static final KeyMapping.Category CATEGORY =
            KeyMapping.Category.register(Identifier.fromNamespaceAndPath(MOD_ID, "main"));
    private static final KeyMapping TOGGLE_KEY = KeyMappingHelper.registerKeyMapping(
            new KeyMapping("key.automine.toggle", InputConstants.Type.KEYSYM, InputConstants.KEY_G, CATEGORY));
    private static final KeyMapping MENU_KEY = KeyMappingHelper.registerKeyMapping(
            new KeyMapping("key.automine.menu", InputConstants.Type.KEYSYM, InputConstants.KEY_M, CATEGORY));

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(AutoMineClient::onEndTick);
    }

    private static void onEndTick(Minecraft mc) {
        boolean screenOpen = mc.gui.screen() != null;
        while (TOGGLE_KEY.consumeClick()) {
            if (!screenOpen) {
                AutoMiner.toggle(mc);
            }
        }
        while (MENU_KEY.consumeClick()) {
            if (!screenOpen) {
                mc.gui.setScreen(new AutoMineScreen());
            }
        }
        AutoMiner.tick(mc);
    }
}