⛏️ Features
Vein Mining
Break one ore block and all connected ores of the same type will be mined automatically. Supports all vanilla ores including deepslate variants and nether ores.
Tree Capitator
Chop one log with an axe and the entire tree falls instantly. All connected logs of the same wood type are broken together.
Auto-Smelt
When enabled, iron, gold, and copper ores are automatically smelted into ingots. Consumes fuel items (coal, charcoal, etc.) from your inventory.
Ore Highlighting
Right-click an ore with a pickaxe to see particle effects on all connected ore blocks in the vein. Great for planning your mining!
Silk Touch Support
When using a Silk Touch pickaxe, ore blocks drop as themselves instead of raw materials.
Cooldown System
Configurable cooldown between vein mining actions to balance gameplay.
Tool Durability
Tool durability is consumed for each block mined. Respects Unbreaking enchantment for reduced durability loss.
Configurable Commands
All commands can be individually enabled/disabled with customizable permission groups.
🎮 Commands
| Command | Description | Default Permission |
|---|---|---|
/veinminer |
Shows plugin usage information | Everyone |
/veinminer help |
Displays all available commands | Everyone |
/veinminer toggle |
Toggles vein mining on/off for yourself | Everyone |
/veinminer status |
Shows your current vein mining settings | Everyone |
/veinminer reload |
Reloads the plugin configuration | Operators |
🔐 Permissions
| Permission | Description | Default |
|---|---|---|
veinminer.use |
Allows basic VeinMiner usage | true |
veinminer.command.reload |
Allows reloading configuration | op |
veinminer.command.toggle |
Allows toggling vein mining | true |
veinminer.command.help |
Allows viewing help | true |
veinminer.command.status |
Allows viewing status | true |
⚙️ Configuration
General Settings
| Setting | Description | Default |
|---|---|---|
max_horizontal_range |
How far horizontally to search for ores | 5 |
max_vertical_range |
How far vertically to search for ores | 5 |
require_same_type |
Only mine ores matching the first broken | true |
give_exp |
Award XP when vein mining | true |
take_durability |
Consume tool durability per block | true |
max_blocks |
Maximum blocks mined per action | 64 |
max_vein_size |
Absolute maximum vein size (lag prevention) | 128 |
cooldown_seconds |
Cooldown between vein mining actions | 2 |
sneak_to_veinmine |
Require sneaking to activate | false |
Display Settings
| Setting | Description | Default |
|---|---|---|
show_vein_message |
Show action bar message after mining | true |
vein_message |
The message format (%blocks% = count) | "&aVein mined &e%blocks% &aadditional blocks!" |
enable_highlighting |
Allow right-click ore highlighting | true |
Tool Settings
| Setting | Description | Default |
|---|---|---|
tool_list_mode |
"whitelist" or "blacklist" mode | blacklist |
tool_list |
Tools for whitelist/blacklist | [WOODEN_PICKAXE] |
enable_silk_touch_mode |
Drop ore blocks with Silk Touch | false |
Tree Capitator Settings
| Setting | Description | Default |
|---|---|---|
enable_tree_capitator |
Enable tree chopping feature | true |
tree_capitator_max_blocks |
Maximum logs chopped at once | 64 |
tree_capitator_sneak_required |
Require sneaking to chop trees | false |
Auto-Smelt Settings
| Setting | Description | Default |
|---|---|---|
enable_auto_smelt |
Enable automatic ore smelting | false |
auto_smelt_fuels |
Items that count as fuel | [COAL, CHARCOAL, COAL_BLOCK, LAVA_BUCKET, BLAZE_ROD] |
Command Settings
Each command can be configured individually:
commands:
reload:
enabled: true
permission: "op"
toggle:
enabled: true
permission: "default"
help:
enabled: true
permission: "default"
status:
enabled: true
permission: "default"
Permission Values:
"default"- All players can use the command"op"- Only operators can use the command"custom.permission.node"- Players with this permission can use it
📋 Supported Blocks
Ores (Vein Mining)
- Coal Ore / Deepslate Coal Ore
- Iron Ore / Deepslate Iron Ore
- Copper Ore / Deepslate Copper Ore
- Gold Ore / Deepslate Gold Ore
- Diamond Ore / Deepslate Diamond Ore
- Emerald Ore / Deepslate Emerald Ore
- Lapis Ore / Deepslate Lapis Ore
- Redstone Ore / Deepslate Redstone Ore
- Nether Gold Ore
- Nether Quartz Ore
Logs (Tree Capitator)
- Oak Log
- Spruce Log
- Birch Log
- Jungle Log
- Acacia Log
- Dark Oak Log
- Mangrove Log
- Cherry Log
- Crimson Stem
- Warped Stem
Auto-Smelt Conversions
- Raw Iron → Iron Ingot
- Raw Gold → Gold Ingot
- Raw Copper → Copper Ingot
- Ancient Debris → Netherite Scrap
All Versions
+ Add Version### Added
- Added admin-only undo/rollback command (
/veinminer undo) to restore the last vein mining action - Added particle and sound effects during vein mining and highlighting (configurable via
effects.particlesandeffects.sounds) - Added in-game configuration GUI (
/veinminer config) for easier plugin management - Added WorldGuard and GriefPrevention integration to respect protected regions
- Added tree capitator leaf handling options (
tree_capitator_break_leaves,tree_capitator_decay_leaves) - Added cooldown cleanup task to prevent memory leaks from offline player cooldowns
- Added auto-smelt support for raw metal blocks (raw iron block, raw gold block, raw copper block)
- Added Silk Touch support for raw metal blocks
- Added
/veinminer configcommand alias for GUI access
### Fixed
- Fixed Silk Touch mode duplicating drops by both dropping the silk-touched item and leaving the block in place
- Fixed auto-smelt consuming fuel per drop instead of per block mined, causing excessive fuel usage
- Fixed tool durability being applied after tool breaks, causing errors when setting damage on null items
- Fixed Tree Capitator ignoring horizontal and vertical range limits, allowing infinite tree scanning
- Fixed Tree Capitator not respecting tool whitelist/blacklist configuration
- Fixed player mining modes not persisting across server restarts or plugin reloads (moved to ConcurrentHashMap)
- Fixed cooldown maps growing indefinitely without cleanup for offline players
- Fixed getOreExpDrop creating new Random instance on every call instead of reusing shared instance
- Fixed vein message showing total blocks mined instead of additional blocks (off by one)
- Fixed queue processor not handling exceptions, potentially leaving tasks in inconsistent state
- Fixed tool reference captured at vein start becoming stale if player switches tools mid-vein
- Fixed highlighting cooldown message using wrong action name for tree highlighting
- Fixed experience drops not scaling with Fortune enchantment level
- Fixed onDisable not clearing cooldown maps, causing memory leaks on reload
- Fixed Silk Touch mode not working for all supported ore types (added missing deepslate variants)
### Changed
- Updated tool validation to use current tool from player inventory with fallback to captured tool
- Updated durability handling to apply damage at task completion instead of per-block during mining
- Added queued vein processing that mines connected blocks in small batches each tick to reduce lag spikes.
- Added per-world control using
enabled_worldsanddisabled_worlds. - Added
/veinminer mode <ore|tree|both|off>so players can switch between ore-only, tree-only, both, or fully off. - Added a configurable
queue_batch_sizesetting for tuning processing smoothness and speed. - Added separate command settings for the new
modesubcommand.
### Changed
- Split mining cooldown behavior into separate settings:
ore_cooldown_secondsandtree_cooldown_seconds. - Updated cooldown handling so ore actions and tree actions now use independent cooldown timers.
- Updated
/veinminer togglebehavior to switch betweenoffandbothmode. - Updated
/veinminer statusand/veinminer helpto include the new mode and cooldown details.
#### Tree Capitator Feature
- New tree chopping system that breaks all connected logs when using an axe
- Supports all vanilla log types including Nether stems
- Configurable maximum blocks per chop (
tree_capitator_max_blocks) - Optional sneak requirement (
tree_capitator_sneak_required) - Separate enable/disable toggle (
enable_tree_capitator)
#### Auto-Smelt System
- Automatically smelt iron, gold, and copper ores into ingots
- Consumes fuel from player inventory (coal, charcoal, coal blocks, lava buckets, blaze rods)
- Configurable fuel types in
auto_smelt_fuelslist - Bonus smelting XP awarded to players
- Does not activate when using Silk Touch pickaxe
#### Configurable Commands
- All commands can now be individually enabled or disabled
- Customizable permission groups per command:
"default"- All players"op"- Operators only- Custom permission nodes supported
#### New Commands
/veinminer help- Shows all available commands with descriptions/veinminer status- Displays current vein mining settings for the player
- Silk Touch Mode:** A new option
enable_silk_touch_modehas been added to the configuration (config.yml). When set totrue, vein mining with a Silk Touch enchanted tool will convert ore blocks to their silk-touched versions (e.g., diamond ore remains as diamond ore block). - Cooldown Settings:** Added
cooldown_secondsoption to the configuration to set a cooldown period between vein mining actions to prevent spam. - Maximum Vein Size Limits:** Added
max_vein_sizeoption to the configuration to prevent extremely large veins that could cause server lag.
### Improvements
- Diagonal Ore Detection:** Improved ore detection algorithm to check all 26 adjacent blocks (including diagonals) instead of just 6 directions, making vein detection more accurate.
- Better XP Drops:** Corrected experience drop values to match Minecraft's standard values for each ore type.
- Tool Break Handling:** Fixed tool breakage handling to prevent issues when updating durability after a tool has already broken.
- Toggle Vein Mining:** Players can now enable or disable vein mining for themselves using the
/veinminer togglecommand. This requires theveinminer.usepermission. - Sneak to Veinmine:** A new option
sneak_to_veinminehas been added to the configuration (config.yml). When set totrue, players must be sneaking (holding shift) to trigger a vein mine. - Tool Whitelist/Blacklist:** Server owners can now control which pickaxes are allowed for vein mining.
- A new
tool_list_modeoption inconfig.ymlcan be set to either"whitelist"or"blacklist". - The
tool_listin the config allows you to specify the materials for the list (e.g.,"DIAMOND_PICKAXE").
### Changes
- The
/veinminercommand now shows usage forreloadandtoggle. - Added a new permission
veinminer.use(defaults totrue) which is required to use the/veinminer togglecommand and the vein mining feature itself.
Added new configurable options:
show_vein_message (boolean) → toggles whether the player sees an action bar message when mining veins.
vein_message (string) → allows customizing the vein mining message with placeholder %blocks%.
enable_highlighting (boolean) → allows enabling/disabling vein highlighting via right-click.
Updated default ores list for Minecraft 1.21, including proper ordering and new variants.
Default messages now use color codes with & (configurable).
2. Vein Mining Behavior
BlockBreakEvent is now fully cancelled for ores to manually handle drops and XP:
event.setCancelled(true);
event.setDropItems(false);
event.setExpToDrop(0);
Original block is now processed the same as vein blocks, instead of skipping it.
XP calculation now uses a new method getOreExpDrop(Material type) for more controlled and configurable XP drops per ore type.
Durability handling improved:
Correctly handles Unbreaking enchantment with proper chance calculation.
Tools now break naturally if durability is exceeded during vein mining, with a message to the player.
Tool meta is updated after all blocks are mined instead of updating per block.
Block drop handling is more robust:
Drops are manually spawned in the world for all mined blocks.
Ensures only valid ores are dropped.
Action bar message now uses configurable veinMessage and only displays if showVeinMessage is true.
Supports %blocks% placeholder.
Only shows if more than 1 block is mined.
3. New Feature – Vein Highlighting
Added right-click highlighting for ore veins:
Triggered on PlayerInteractEvent when right-clicking an ore block with a pickaxe.
Shows CRIT particle effects on all vein blocks.
Shows a chat message indicating the number of blocks in the vein.
Respects enableHighlighting and maxBlocks limits.
Supports requireSameType config.
4. Code Optimizations / Refactors
isPickaxe(Material) helper method added for tool checks.
findAdjacentOres:
Uses a separate visited set for O(1) lookup (performance improvement).
Vein scanning logic remains the same but now avoids redundant additions.
BlockBreakEvent processing streamlined with local variables:
isDamageable, damageable, currentDamage, maxDurability, isUnbreakable.
XP and drops calculation separated from event logic.
getOreExpDrop(Material type) provides consistent XP drops per ore type.
Removed redundant checks and simplified durability/unbreaking handling.
Tool meta casting safely with Damageable instead of direct ItemMeta.
5. Minor Improvements
Messages now use ChatColor for consistent coloring.
/veinminer command usage message updated with version info.
Command permission and reload logic remain the same but cleaner.
Added safeguards for null tools, unbreakable items, and invalid ore types.
Improvements:
Config Defaults & Reloads: Implemented saving defaults, copying values, and reloading configurations cleanly.
Flexible Ore List: Allowed server administrators to customize the list of ores through the configuration file.
BFS Vein Search: Replaced recursion with a queue-based BFS algorithm to avoid stack overflow issues during vein mining.
Durability Handling: Correctly accounted for the Unbreaking enchantment when applying durability damage to tools.
Action Bar Feedback: Added user experience enhancements by displaying the number of additional blocks mined in the action bar.
Permission Check for Reload: Implemented permission checks to restrict access to the reload command.
Fixes:
Removed Duplicate Imports: Cleaned up the code by removing duplicate import statements.
XP Calculation: Adjusted XP handling to ensure it aligns with vanilla mechanics, providing appropriate rewards for mined ores.
Durability Application: Fixed the issue of double counting durability damage for the original mined block.
Block Drops Duplication: Ensured that drops for the original block are not duplicated, preventing inconsistencies.
Efficiency: Enhanced performance by breaking early once the maximum block limit is reached, reducing unnecessary processing.
Silk Touch Check: Added support for the Silk Touch enchantment, allowing players to mine ores without breaking them into drops.
Tool Whitelist: Implemented a check to ensure only pickaxes can activate vein mining, preventing unintended usage with bare hands.
Multi-thread Safety: Considered offloading scanning to async to improve performance for large veins (optional).
Fixes:
Distance Check Bug: Corrected the distance checks in the BFS algorithm to ensure accurate range limits from the original mined block.
Missing Imports: Added missing imports for Collectors and Enchantment to ensure the code compiles correctly.
Enhanced XP Handling: Improved XP calculation by utilizing the BlockExpEvent for extra blocks, allowing for better integration with other plugins.
Improvements:
Documentation: Updated comments and documentation within the code for better clarity and understanding.
Fixes:
General Bug Fixes: Continuously monitored and addressed any bugs or issues reported by users to ensure a smooth experience.