MinionCore logoMinionCore

Miner

How the miner minion picks blocks to mine, how its tool works and which blocks it always leaves alone.

The miner breaks the blocks you list around it and puts the drops in its storage. It pairs well with a cobblestone generator or a patch of ore, and it is built so it can never dig out from under itself or break into a chest.

Side view of a level 2 miner's area showing listed blocks marked as mined, while the block under the miner, the block under another minion, a chest and a dirt block that is not in the list are marked as never mined, and blocks outside the dashed area are faded.

The blocks it mines

The list lives under settings.blocks in minions/miner.yml. The shipped list is:

settings:
  blocks:
    - STONE
    - COBBLESTONE
    - DEEPSLATE
    - COAL_ORE
    - DEEPSLATE_COAL_ORE
    - IRON_ORE
    - DEEPSLATE_IRON_ORE
    - COPPER_ORE
    - DEEPSLATE_COPPER_ORE
    - GOLD_ORE
    - DEEPSLATE_GOLD_ORE
    - REDSTONE_ORE
    - DEEPSLATE_REDSTONE_ORE
    - LAPIS_ORE
    - DEEPSLATE_LAPIS_ORE
    - DIAMOND_ORE
    - DEEPSLATE_DIAMOND_ORE

Add or remove block names to change what it mines. A name that is not a block on your Minecraft version is skipped, and the console says which one.

The miner breaks anything in the list, so only list blocks you are happy to lose. A block like BEDROCK in the list would be mined too.

ItemsAdder blocks

Custom blocks from ItemsAdder go in the same list, written as itemsadder:namespace:id:

settings:
  blocks:
    - STONE
    - itemsadder:myores:ruby_ore

Their drops come from ItemsAdder, so they drop what the block is set up to drop there. If ItemsAdder is not installed, these entries are skipped and a warning is logged once.

The tool

settings:
  tool:
    material: DIAMOND_PICKAXE
    enchantments:
      fortune: 0
      silk_touch: 0

The miner works out its drops as if this tool broke the block, so enchantments change the result:

EnchantmentEffect
fortuneMore drops from ores, the same as a player's Fortune pickaxe.
silk_touchOres and stone drop as the block itself, for example DIAMOND_ORE instead of a diamond.

A level of 0 means the enchantment is not added. If the tool section is missing, a plain diamond pickaxe is used. The tool also matters for blocks that need a certain pickaxe to drop anything, just like for a player.

Silk touch upgrade

The shipped silk-touch upgrade in upgrades.yml accepts miners. Once applied, silk touch is added to the tool while the drops are worked out, so ores and stone drop as the block itself even when silk_touch is 0 in the type file. A miner takes at most one. See Levels and upgrades.

Block list

settings:
  block-list:
    mode: OFF
    blocks: []

The block list is checked before settings.blocks, so it can narrow down a long list or a list shared by several miner types without editing the list itself.

modeWhat it does
OFFThe list is not used. This is the shipped value.
BLACKLISTBlocks named in blocks are never mined, even when settings.blocks has them.
WHITELISTOnly blocks named in blocks are mined, and they still have to be in settings.blocks.

Entries are block names or ItemsAdder blocks written as itemsadder:namespace:id. A mode other than the three above logs a warning and switches the list off, and a name that is not a block on your version is skipped with a warning.

Players can also narrow this down per minion with the block filter, which is checked after this list.

Blocks it never mines

Whatever is in either list, a miner leaves these alone:

  • Blocks with contents. Chests, barrels, furnaces, hoppers, spawners, signs and every other block that holds data or items are skipped, even if they are listed. Nothing stored inside a block can be lost to a miner.
  • Its own support block. The block the miner stands on is never broken.
  • Another minion's support block. The block under any other minion is never broken either, whoever owns that minion.
  • Blocks outside its area. The area is the range of the current level in every direction and height blocks up and down (1 in the shipped file). Nothing outside it is touched.

Order

settings:
  order: NEAREST
ValueWhat happens
NEARESTThe closest minable block is broken first.
RANDOMA random minable block in the area is picked each time.

The miner breaks one block per action, at the speed set by the delay of its level.

New blocks in the area

Blocks placed by players, formed by a cobblestone generator, pushed in by pistons and the like are noticed as soon as they appear. As a safety net, each minion also rebuilds its list of target blocks every performance.rescan-interval seconds from config.yml (300 by default).

Blocks set with /fill or /setblock send no event to plugins, so the miner only sees them on its next rescan.

On this page