Compatibility
Minecraft: Java Edition
Platforms
Links
Creators
Details
VeinMiner is a function that enables you to break a bunch of same blocks attached to each other by mining just one of them. This data pack implements the function with vanilla commands, making your gameplay more comfortable even in vanilla versions of Minecraft.
Features
- Fully customizable from blocks which can be vein-mined to tools that can trigger vein-mining for a certain type of block.
- User-friendly configuration menu.
- Compatible with nearly all vanilla and modded blocks.
- Various settings to achieve best experience, including safety measures to prevent you from accidentally vein-mining your masterpiece.
- Simulation of tool enchantment's effect as well as hunger and tool durability's behavior, like real mining.
- Vein-mining animation that gradually breaks the blocks in the vein layer by layer.
This data pack uses the experimental feature: Dialog, you may need to rejoin the world or restart the server after (un)installing the data pack!
The data pack is ready-to-use. You may also read the "Notes & Tips" part at the bottom if you ran into a problem or report an issue. If you want to customize the data pack, please read the following information.
Planned Update: Treecapitator integration
Settings
You can find the settings menu in the data pack's info menu, which you can access from Minecraft's Game Menu or Quick Actions menu. You can also directly access the data pack's settings menu by running command:
/function ultimate_veinminer:setting
All available settings are described below:
| Setting | Value Range | Description | Default Value |
|---|---|---|---|
| Max Blocks | integer, 0~2147483647 |
How many blocks of the same type at most can be vein-mined for each block the player has mined. This value is ignored when [Efficiency Mode] is turned on. | 100 |
| Drop Mode | Player / Center / Block |
Where loot items and experience orbs from mining blocks should appear, also applies to stored items when mining container blocks.Player: at the miner's feetCenter: at the mined block which triggered vein-miningBlock: at their corresponding block (which generated the loot after being mined) |
Player |
| Animation Duration | integer, 0~10 |
How long to wait before breaking the next layer of blocks during animation. Set to 0 to disable animation and break all blocks simultaneously. |
0 |
| Enable Silk Touch | true / false |
Whether using items with "Silk Touch" enchantment can trigger vein-mining. | true |
| Tool Only | true / false |
Whether the item you use for mining need to have a "minecraft:tool" item stack component in order to trigger vein-mining (e.g. axes, pickaxes). Note: Vein-mining cannot be triggered when you have nothing in your main hand! |
true |
| Allow Break Tool | true / false |
Whether it is allowed to use up the durability of your mining tool when vein-mining. Set to false to ensure at least 1 durability left. |
false |
| Safety Mode | None /When Sneaking / When Not Sneaking |
How can vein-mining be triggered when a player mines a block.None: always triggerWhen Sneaking: player need to sneakWhen Not Sneaking: player must not sneak |
None |
| Strict Check | true / false |
Whether to verify the type of every block before breaking it during vein-mining animation. The block will not be vein-mined if it has been changed after the animation started. | false |
| Efficiency Mode | true / false |
Gradually calculate vein area during animation, may reduce instantaneous calculational load and improve performance when mining huge veins. There is no limit on the maximal count of vein-mined blocks in this mode. Requires [Animation Duration] not set to 0! |
false |
| Further Vein | true / false |
Whether blocks which only share a vertex or an edge can also be vein-mined. When set to false, only blocks which share a face can be vein-mined. |
false |
Configuration & Other Functions
You can also find the following configurations in the data pack's settings menu.
VeinMiner Block List
The list of all blocks that you can vein-mine.
This list by default contains most of the ores and logs in vanilla Minecraft. You can add blocks to this list (by entering block ID) or remove blocks from this list at any time.
From here you can access the block menu of each block, which contains detailed information. Here you can modify the block's mine loot (if the data pack failed to generate it correctly) or reset its watch lists, which is crucial for triggering vein-mining.
There are also other useful functions such as adding your targeted block (the block you are looking at) to the list or automatically regenerate cached information of all block's mine loot.
Accepted Tool
All the items you may use to trigger vein-mining. Can be item IDs or tags.
There are 2 types of Accepted Tool:
· The Global Accepted Tool list (in the settings menu) applies to all blocks.
· The Accepted Tool for a block (in the block menu of each block) applies only to this block. If it is empty, then the global list is applied to this block.
If an empty list is applied to a block, then any item can trigger vein-mining for this block. This list should typically contains mining tools for this block, but you can also add other items. Note that [Tool Only] setting also has an effect on top of this, so you may set it to false in oder that the Accepted Tool functions properly.
Advanced Settings
Some useful functions.
You can manually set a Test Position. The Test Position is a block coordinate used for generating cached information of block's mine loot. The data pack should be able to find a position by itself, when it failed to find one before using it, you will be asked to input a Test Position. You should enter a coordinate that doesn't take long to load (normally near your current location) and is currently an air block.
Other functions like temporarily disable vein-mining function or uninstall the data pack completely.
You may explore the data pack and discover all the practical functions on your own.
Commands
Here are some commands you can use for your own convenience.
Open data pack info menu
/function ultimate_veinminer:help
Open settings menu
/function ultimate_veinminer:setting
Temporarily disable vein-mining function
/function ultimate_veinminer:disable
Enable vein-mining function
/function ultimate_veinminer:enable
Uninstall data pack
/function ultimate_veinminer:uninstall
Notes & Tips
- There are a few requirements for triggering vein-mining. If vein-mining is not triggered as expected, check the following conditions:
· Loot items entity appears after you mined the block (your mining tool is "correct for drop" and game rules are properly set)
· You are holding an item in your main hand
· (When [Tool Only] setting istrue) The item has a "minecraft:tool" item stack component, typically for mining tools like axes and pickaxes
· The item doesn't have "Silk Touch" enchantment or [Enable Silk Touch] setting istrue
· The item is on the list of Accepted Tool for the type of the block you've mined
· You are sneaking or not sneaking according to [Safety Mode] setting\ - During vein-mining animation, you can interrupt the process by stop holding the tool you used for mining. For example, simply switch to another hotbar slot. This is meant to minimize the damage caused by accidentally triggering vein-mining.
- Avoid vein-mining container blocks (e.g. chests, barrels) in case the stored items get deleted, although this shouldn't technically happen.
- Your hunger bar will decrease and the tool you use will get damaged as if you mined all these blocks one by one. All enchantments and data components of the mining tool will also be taken into account, affecting the amount of durability consumed and loot you get from mining blocks.
· Mechanics like the enchantment "Mending" will only be applied after the vein-mining has been executed. - Avoid mining blocks with items that has durability but not tool (e.g. helmets) to trigger vein-mining in case of unexpected durability drop.
- Don't add blocks that have inconsistent mine loot or no mine loot (e.g. leaves) to VeinMiner Block List, vein-mining cannot (always) be triggered for these blocks.
- NEVER mine too many blocks in a single vein! Limit the maximal block count using [Max Blocks] setting. Mining too many blocks in a single vein may lead to unexpected behaviors and huge latency.
· If errors occur even when mining a small vein, try setting the game rule "maxCommandChainLength" or "minecraft:max_command_sequence_length" to a bigger value.



