Build an automated armor stand miner in Minecraft that marches forward, swings its pickaxe to carve through stone tunnels, and places torches to light the way.
Spawners & GeneratorsIndustrialTechnologyCyanYellowWhiteBuilding ToolAdventure MapMap MakingArmor standsSummoned mobsBlock building (fill/setblock/clone)Sounds21+ commands
Digging long mining tunnels by hand takes ages, so why not let an automated robot do the heavy lifting? This command creation summons an armored miner that marches forward on its own, swinging an enchanted diamond pickaxe to shatter solid stone and ore veins while leaving a trail of wall torches behind.
We build a cutaway mineshaft so you can watch the miner work from the side in the night. Glowing sparks, floating ore chunks, and realistic arm-swinging animations bring the little mechanical worker to life using vanilla command blocks.
/gamerule send_command_feedback false/scoreboard objectives add c9_tick dummy/scoreboard objectives add c9_step dummy/fill ~-9 ~ ~-3 ~9 ~4 ~1 minecraft:stone/fill ~-9 ~ ~-1 ~9 ~3 ~1 minecraft:air/fill ~-8 ~1 ~-2 ~8 ~2 ~-2 minecraft:diamond_ore replace minecraft:stone/fill ~-9 ~ ~-1 ~9 ~2 ~1 minecraft:stone/fill ~-9 ~ ~ ~-6 ~1 ~1 minecraft:air/summon minecraft:armor_stand ~-7 ~ ~0.5 {Tags:["c9_miner","c9_ent"],NoBasePlate:1b,ShowArms:1b,Rotation:[-90f,0f],Glowing:1b,CustomName:'{"text":"Auto-Miner","color":"aqua"}',CustomNameVisible:1b,equipment:{mainhand:{id:"minecraft:diamond_pickaxe",count:1,components:{"minecraft:enchantment_glint_override":true}},offhand:{id:"minecraft:torch",count:1},head:{id:"minecraft:golden_helmet",count:1},chest:{id:"minecraft:iron_chestplate",count:1},legs:{id:"minecraft:iron_leggings",count:1},feet:{id:"minecraft:leather_boots",count:1}},Pose:{RightArm:[-45f,0f,0f],LeftArm:[-20f,15f,0f]}}/execute as @e[tag=c9_miner] run scoreboard players add @s c9_tick 1/execute as @e[tag=c9_miner,scores={c9_tick=1..5}] run data merge entity @s {Pose:{RightArm:[-110f,-10f,0f],LeftArm:[-35f,15f,0f],RightLeg:[25f,0f,0f],LeftLeg:[-25f,0f,0f]}}/execute as @e[tag=c9_miner,scores={c9_tick=6..10}] run data merge entity @s {Pose:{RightArm:[-25f,5f,0f],LeftArm:[-15f,15f,0f],RightLeg:[-25f,0f,0f],LeftLeg:[25f,0f,0f]}}/execute as @e[tag=c9_miner,scores={c9_tick=6}] at @s run particle minecraft:block{block_state:{Name:"minecraft:stone"}} ~0.8 ~1.1 ~ 0.3 0.4 0.3 0.15 25/execute as @e[tag=c9_miner,scores={c9_tick=6}] at @s run particle minecraft:crit ~0.8 ~1.2 ~ 0.2 0.2 0.2 0.3 12/execute as @e[tag=c9_miner,scores={c9_tick=6}] at @s run playsound minecraft:block.stone.hit block @a ~ ~ ~ 0.7 1.2/execute as @e[tag=c9_miner,scores={c9_tick=10..}] at @s if block ~1 ~ ~ minecraft:stone run playsound minecraft:block.stone.break block @a ~ ~ ~ 1 0.9/execute as @e[tag=c9_miner,scores={c9_tick=10..}] at @s if block ~1 ~ ~ minecraft:stone run particle minecraft:dust{color:[0.2,0.9,1.0],scale:1.4} ~1 ~1 ~-0.3 0.3 0.5 0.3 0.05 18/execute as @e[tag=c9_miner,scores={c9_tick=10..}] at @s run fill ~1 ~ ~-0.4 ~1 ~1 ~0.4 minecraft:air destroy/execute as @e[tag=c9_miner,scores={c9_tick=10..}] at @s run tp @s ~0.5 ~ ~/execute as @e[tag=c9_miner,scores={c9_tick=10..}] run scoreboard players add @s c9_step 1/execute as @e[tag=c9_miner,scores={c9_tick=10..}] run scoreboard players set @s c9_tick 0/execute as @e[tag=c9_miner,scores={c9_step=6..}] at @s run setblock ~ ~1 ~-0.4 minecraft:wall_torch[facing=south]/execute as @e[tag=c9_miner,scores={c9_step=6..}] at @s run scoreboard players set @s c9_step 0setup #9 Summons the Auto-Miner armor stand facing east (<code>Rotation:[-90f,0f]</code>) with arms enabled, glowing active, and full mining gear stored in the <code>equipment</code> compound.loop #2 During the first 5 ticks of the cycle, raises the right pickaxe arm up high (<code>-110f</code> degrees) and swings the legs to simulate a walking stride.loop #3 During ticks 6 to 10, brings the pickaxe arm down sharply (<code>-25f</code> degrees) to strike the stone wall in front of the miner and reverses the leg positions.loop #9 Every 10 ticks, breaks the 1x2 column of stone directly ahead using <code>fill ... destroy</code> so real block particles and cobblestone items drop onto the floor.loop #13 Every 6 half-block steps (3 full blocks traveled), places a south-facing <code>wall_torch</code> on the back wall of the cutaway tunnel to illuminate the path.


Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: A glowing armor stand miner holding a pickaxe digs sideways through a cutaway stone structure at night, dropping cobblestone items along its path, though its nametag shows raw JSON text and no wall torches are visible.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To deploy the miner wherever you are standing in survival or creative mode, skip the stone wall setup commands and summon the c9_miner armor stand at your own position using /execute at @p run summon minecraft:armor_stand ~ ~ ~ .... Because the movement and digging commands use local offsets along the X axis, face east when deploying it, or replace the relative offsets (~0.5 ~ ~ and ~1 ~ ~) with caret coordinates (^ ^ ^0.5 and ^ ^ ^1) so the miner digs in whatever direction you point it.
/kill @e[tag=c9_ent]/kill @e[type=minecraft:item,distance=..22]/fill ~-10 ~ ~-4 ~10 ~5 ~2 minecraft:air/scoreboard objectives remove c9_tick/scoreboard objectives remove c9_step/gamerule send_command_feedback trueThe setup builds a cutaway cross-section of a mineshaft with a diamond ore backing wall so you can watch the miner dig and place torches from the outside without solid stone blocking your view.
Change the score check in the last two loop commands from c9_step=6.. to a higher number like c9_step=12.. (since each step is half a block, 12 steps equals 6 blocks between torches).
/data/execute/fill/gamerule/particle/playsound/scoreboard/setblock/summon/tp
▶Tesla Coil Lightning Arc SpawnerSpawners & GeneratorsMedium24 cmds
▶3D Conveyor Belt LoopSpawners & GeneratorsMedium26 cmds
▶Automated Conveyor AssemblySpawners & GeneratorsEasy24 cmds
▶Automated Conveyor FactorySpawners & GeneratorsEasy24 cmds
▶Automated Crop HarvesterSpawners & GeneratorsMedium24 cmds
▶Automated Factory Assembly LineSpawners & GeneratorsMedium24 cmds