William Jarlestrom

make some pickaxe with 2x2 mining and 4x4mining 5x5 mining 10x10mining and more x

Kodari AI
KodariOct 9 at 4:32 pm 1
AreaMiningTools
AreaMiningTools is a Minecraft plugin that introduces specialized pickaxes capable of mining in expanded area patterns. Players can craft or obtain pickaxes that mine 2x2, 4x4, 5x5, 10x10, or larger block areas simultaneously. Each tool type has configurable durability costs, mining speeds, and enchantment compatibility. The plugin includes a command system for admins to grant tools, a crafting recipe system for each tier, and a permission-based access system. Mining efficiency scales with tool tier, and the plugin automatically handles ore preservation, block type filtering, and inventory space management. Customizable settings allow server owners to adjust area sizes, durability multipliers, and recipe requirements.
  1. Add the Paper plugin scaffold and configurable pickaxe sizes.

  2. Add /miningpickaxe give and square-area mining in the block’s facing plane.

Created the MiningPickaxes plugin with configurable 2×2, 4×4, 5×5, 10×10, 15×15, and 20×20 pickaxes. Add more sizes in config.yml; give one with /miningpickaxe give <player> <size>. Area mining follows the block’s facing plane and skips tile entities and unloaded chunks.

William Jarlestrom

where download mod

Kodari AI
KodariOct 9 at 4:33 pm 1

It’s a Minecraft plugin, not a mod. To download its .jar:

  1. Click Compile in the top bar (on phone: ⋮ → Compile Project).

  2. Click Compile in the window.

  3. After it succeeds, click Download for the build—or Download MiningPickaxes.jar in the chat.

William Jarlestrom

make it mod and 1.21.11 fabric

Kodari AI
KodariOct 9 at 4:39 pm 5
  • Replace the Paper build with Fabric Loom for Minecraft 1.21.11 and Java 21.

  • Convert commands and area mining to Fabric APIs; keep /miningpickaxe give <player> <size> working for sizes 2–50.

  • Replace the plugin descriptor with Fabric metadata and remove the unused Bukkit config.

Converted it to a Fabric mod for Minecraft 1.21.11. It supports square mining sizes from 2×2 through 50×50; operators can use /miningpickaxe give <player> <size>.

To download the .jar, click Compile in the top bar, then Compile in the window. When it succeeds, click Download. The mod requires Fabric Loader and Fabric API.

William Jarlestrom

it say missing required files

Kodari AI
KodariOct 9 at 4:41 pm 1

The project currently has build.gradle, settings.gradle, fabric.mod.json, and the mod’s Java entrypoint. What exact “missing required files” message do you see? Paste it here or send a screenshot so I can fix the specific issue.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 181
src/main/java/com/kodari/miningpickaxes/MiningPickaxesPlugin.java
package com.kodari.miningpickaxes;

import com.mojang.brigadier.arguments.IntegerArgumentType;
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
import net.fabricmc.fabric.api.event.player.PlayerBlockBreakEvents;
import net.fabricmc.api.ModInitializer;
import net.minecraft.ChatFormatting;
import net.minecraft.commands.Commands;
import net.minecraft.commands.arguments.EntityArgument;
import net.minecraft.core.BlockPos;
import net.minecraft.core.component.DataComponents;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.phys.Vec3;

public final class MiningPickaxesPlugin implements ModInitializer {
    private static final String PICKAXE_SIZE_KEY = "mining_pickaxe_size";
    private static boolean areaMining;

    @Override
    public void onInitialize() {
        CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) ->
                dispatcher.register(Commands.literal("miningpickaxe")
                        .requires(source -> source.hasPermission(2))
                        .then(Commands.literal("give")
                                .then(Commands.argument("player", EntityArgument.player())
                                        .then(Commands.argument("size", IntegerArgumentType.integer(2, 50))
                                                .executes(context -> {
                                                    ServerPlayer target = EntityArgument.getPlayer(context, "player");
                                                    int size = IntegerArgumentType.getInteger(context, "size");
                                                    ItemStack pickaxe = createPickaxe(size);
                                                    target.getInventory().add(pickaxe);
                                                    if (!pickaxe.isEmpty()) {
                                                        target.drop(pickaxe, false);
                                                    }
                                                    context.getSource().sendSuccess(
                                                            () -> Component.literal("Gave a " + size + "x" + size
                                                                    + " mining pickaxe to " + target.getGameProfile().getName() + "."),
                                                            false
                                                    );
                                                    return 1;
                                                }))))));

        PlayerBlockBreakEvents.AFTER.register((world, player, pos, state, blockEntity) -> {
            if (areaMining || !(world instanceof ServerLevel serverWorld)) {
                return;
            }

            ItemStack tool = player.getMainHandItem();
            CustomData customData = tool.get(DataComponents.CUSTOM_DATA);
            if (customData == null) {
                return;
            }

            int size = customData.copyTag().getInt(PICKAXE_SIZE_KEY);
            if (size < 2 || size > 50) {
                return;
            }

            Vec3 look = player.getLookAngle();
            double x = Math.abs(look.x);
            double y = Math.abs(look.y);
            double z = Math.abs(look.z);
            int minOffset = -(size / 2);
            areaMining = true;
            try {
                for (int first = minOffset; first < minOffset + size; first++) {
                    for (int second = minOffset; second < minOffset + size; second++) {
                        int offsetX = 0;
                        int offsetY = 0;
                        int offsetZ = 0;

                        if (x >= y && x >= z) {
                            offsetY = first;
                            offsetZ = second;
                        } else if (y >= x && y >= z) {
                            offsetX = first;
                            offsetZ = second;
                        } else {
                            offsetX = first;
                            offsetY = second;
                        }

                        BlockPos targetPos = pos.offset(offsetX, offsetY, offsetZ);
                        if (targetPos.equals(pos) || !serverWorld.hasChunkAt(targetPos)) {
                            continue;
                        }

                        var targetState = serverWorld.getBlockState(targetPos);
                        var targetBlockEntity = serverWorld.getBlockEntity(targetPos);
                        if (targetState.isAir() || targetBlockEntity != null) {
                            continue;
                        }

                        if (!PlayerBlockBreakEvents.BEFORE.invoker().beforeBlockBreak(
                                serverWorld, player, targetPos, targetState, null
                        )) {
                            continue;
                        }

                        if (serverWorld.destroyBlock(targetPos, true, player)) {
                            PlayerBlockBreakEvents.AFTER.invoker().afterBlockBreak(
                                    serverWorld, player, targetPos, targetState, null
                            );
                        }
                    }
                }
            } finally {
                areaMining = false;
            }
        });
    }

    private static ItemStack createPickaxe(int size) {
        ItemStack pickaxe = new ItemStack(Items.DIAMOND_PICKAXE);
        pickaxe.set(DataComponents.CUSTOM_NAME, Component.literal(size + "x" + size + " Mining Pickaxe")
                .withStyle(ChatFormatting.AQUA));

        CompoundTag data = new CompoundTag();
        data.putInt(PICKAXE_SIZE_KEY, size);
        pickaxe.set(DataComponents.CUSTOM_DATA, CustomData.of(data));
        return pickaxe;
    }
}