stranger_sparky

i want a plugin like world edit but for survival player to mine easier example right clicking with pickaxe should markout the area to mine and mining one blocking the marked area should mine the entire area marked with the pickaxe and also add a fail safe to make sure the using tool the pickaxe or should shouldn't break stop at the exact pickaxe or any tool using just brefore its durability end just before it breaks.

Kodari AI
KodariMay 24 at 12:40 pm 9,250 (v2)

I’ll create a survival mining tool that allows players to mark and mine entire areas with durability protection.

EasyMiner
A survival-friendly mining enhancement plugin that allows players to mark out areas by right-clicking with their tools and mine entire regions by breaking a single block. Features intelligent tool durability protection that prevents tools from breaking by stopping mining when durability reaches 1. Supports pickaxes, shovels, axes, and hoes with configurable area limits and visual particle feedback for marked regions.

Now I’ll create the plugin structure:

Perfect! I’ve created EasyMiner - a survival-friendly area mining plugin with intelligent durability protection.

How it works:

  1. Mark Area: Right-click with a tool (while sneaking by default) to set position 1, then again for position 2

  2. Mine All: Break any block in the marked area to mine the entire region

  3. Durability Protection: Automatically stops mining when your tool has only 1 durability left, preventing it from breaking

Key Features:

  • ✅ Works with pickaxes, shovels, axes, and hoes

  • ✅ Configurable max area size (default 5x5x5)

  • ✅ Visual particle feedback showing marked corners

  • ✅ Cooldown system to prevent spam

  • ✅ Permission-based (easyminer.use for players)

  • ✅ Fully configurable messages and settings

  • ✅ XSeries for 1.8-1.21+ compatibility

The durability check ensures tools will always stop with 1 durability remaining, never breaking completely. Players can continue using the tool for normal mining afterward!

stranger_sparky

disable tool durability checking and durability useage

Kodari AI
KodariMay 24 at 1:11 pm 8,188 (v2)

I’ll disable tool durability checking and usage for the area mining feature.

Done! I’ve disabled tool durability checking and usage:

Changes made:

  1. Removed durability checks - The plugin no longer checks if your tool has enough durability before mining

  2. Tools don’t lose durability - Changed block.breakNaturally(tool) to block.breakNaturally() so tools remain at full durability when mining marked areas

  3. Removed config option - Deleted the durability-protection setting from config.yml

  4. Cleaned up code - Removed the isDurabilityProtectionEnabled() method from ConfigManager

Now you can mine infinite blocks with your tool without it ever losing durability or being checked! The tool still needs to be valid (pickaxe, shovel, axe, or hoe) to mark areas, but it won’t be consumed during the area mining process.

stranger_sparky

also i want to find a way to remove mass water and lava

Kodari AI
KodariMay 25 at 8:32 am 6,658 (v2)

I’ll add functionality to remove mass water and lava from marked areas.

Done! I’ve added mass water and lava removal functionality. Here’s what changed:

New Features:

  1. Config Option (config.yml):

    • Added remove-fluids: true - enables/disables fluid removal from marked areas

  2. Fluid Detection:

    • Detects and removes: water, lava, kelp, seagrass, tall seagrass, and bubble columns

    • Uses XMaterial for cross-version compatibility (1.8-1.21+)

  3. Smart Removal:

    • Fluids are instantly removed (set to AIR) without drop items

    • Regular blocks are broken normally and drop items

    • All removed blocks count toward the total mined count

Now when you mine a marked area, all water and lava sources will be completely removed along with the blocks! You can disable this feature by setting remove-fluids: false in the config if needed.

stranger_sparky

i want to use stick to select water/lava and remove it like other blocks

Kodari AI
KodariMay 25 at 8:34 am 13,349 (v2)

I’ll add stick functionality to select and remove water/lava areas.

Done! I’ve added stick functionality for water/lava removal. Here’s how it works:

How to Use:

  1. Select Area: Right-click with a stick (while sneaking) to set position 1, then position 2

  2. Remove Fluids: Left-click on any water/lava block in the marked area with the stick to remove ALL fluids instantly

What Changed:

✅ Stick is now a valid tool - Added to DurabilityManager and config.yml ✅ Fluid removal handler - Left-clicking fluids with a stick removes all water, lava, kelp, seagrass, and bubble columns in the marked area ✅ New message - Added “fluids-removed” message showing how many fluids were cleared ✅ Updated instructions - Position-2-set message now mentions fluid removal with sticks

The stick specifically targets fluids, while pickaxes/shovels/axes/hoes work on regular blocks. Both systems respect the cooldown and marked area limits!

stranger_sparky

also make it tp all diamonds / netherite and items that added to config to tp to the player when mined and dropped

Kodari AI
KodariMay 25 at 10:14 am 25,635 (v2)

I’ll add functionality to automatically teleport valuable items to the player when mined.

Perfect! I’ve added auto-collection functionality for valuable items. Here’s what changed:

New Features:

  1. Config Section (config.yml):

    • auto-collect.enabled - toggle auto-collection on/off

    • auto-collect.items - list of materials to auto-collect (diamonds, emeralds, ancient debris, gold, netherite, etc.)

    • auto-collect.drop-if-full - if inventory is full, drop items at player’s feet instead of losing them

  2. ItemCollectorListener:

    • Detects when valuable items spawn from mining

    • Automatically teleports them to the player’s inventory

    • Groups notifications (e.g., “+5 Diamond” instead of 5 separate messages)

    • Only works within 10 blocks of the player and within 5 seconds of mining start

  3. Smart Collection:

    • Only collects items from players actively mining (tracked via session)

    • Handles full inventory gracefully

    • Works with XSeries for cross-version compatibility

Now when you mine diamonds, emeralds, ancient debris, or any configured item, they’ll automatically go straight to your inventory with a nice notification message!

stranger_sparky

[11:26:04 INFO]: Disconnecting Sparky009 (/103.178.204.19:1438): Failed to verify username! [11:26:04 ERROR]: Username 'Sparky009' tried to join with an invalid session [11:26:04 INFO]: Sparky009 (/103.178.204.19:1438) lost connection: Failed to verify username! [11:26:10 INFO]: Disconnecting Sparky009 (/103.178.204.19:1419): Failed to verify username! [11:26:10 ERROR]: Username 'Sparky009' tried to join with an invalid session [11:26:10 INFO]: Sparky009 (/103.178.204.19:1419) lost connection: Failed to verify username!

dont do session just do tp @ who is mining

Kodari AI
KodariMay 25 at 11:32 am 8,574 (v2)

I’ll simplify the item collection to directly track who’s mining without

Done! I’ve simplified the item collection system to remove session dependency:

What Changed:

  1. Direct Block Break Tracking: Now listens to BlockBreakEvent and records who broke which block with their UUID

  2. Location-Based Matching: When items spawn, checks if they’re within 3 blocks of a recently broken block

  3. Auto-Cleanup: Recent breaks are automatically removed after 2 seconds (40 ticks)

  4. No Session Required: Works independently - just tracks who’s breaking blocks in real-time

Now any player who breaks blocks will automatically collect configured items (diamonds, emeralds, etc.) directly to their inventory without needing session validation. Much simpler and more reliable!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 931
src/main/java/com/easyminer/EasyMiner.java
package com.easyminer;

import com.easyminer.listener.ItemCollectorListener;
import com.easyminer.listener.MiningListener;
import com.easyminer.manager.ConfigManager;
import com.easyminer.session.MiningSession;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class EasyMiner extends JavaPlugin {

    private ConfigManager configManager;
    private final Map<UUID, MiningSession> sessions = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        
        getServer().getPluginManager().registerEvents(new MiningListener(this), this);
        getServer().getPluginManager().registerEvents(new ItemCollectorListener(this), this);
        
        getCommand("easyminer").setExecutor((sender, command, label, args) -> {
            if (!sender.hasPermission("easyminer.admin")) {
                sender.sendMessage(configManager.getMessage("no-permission"));
                return true;
            }
            
            if (args.length > 0 && args[0].equalsIgnoreCase("reload")) {
                reloadConfig();
                configManager = new ConfigManager(this);
                sender.sendMessage(configManager.getMessage("config-reloaded"));
            } else {
                sender.sendMessage(configManager.getMessage("prefix") + "&7EasyMiner v" + getDescription().getVersion());
                sender.sendMessage("&7/easyminer reload &8- &fReload configuration");
            }
            return true;
        });
        
        getLogger().info("EasyMiner has been enabled!");
    }

    @Override
    public void onDisable() {
        sessions.clear();
        getLogger().info("EasyMiner has been disabled!");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public MiningSession getSession(UUID playerId) {
        return sessions.computeIfAbsent(playerId, id -> new MiningSession(playerId));
    }

    public void removeSession(UUID playerId) {
        sessions.remove(playerId);
    }
}