Andrey Kamuz

A mod that adds a drilling rig, like the one in the subway, where you can set the height and width so it can move along the outskirts.

Kodari AI
KodariOct 10 at 12:10 pm 6
SubwayDrillRig
A Minecraft mod that introduces a controllable drilling rig inspired by subway construction machinery. Players can place the rig and configure its height and width dimensions to carve tunnels along the outskirts of the world. The rig moves automatically along a set path, excavating blocks and creating a subway-like passage. Includes configurable speed, block-breaking logic, and visual feedback for the drilling process.
  1. Set up a Fabric 1.20.4 mod project and register the rig block.

  2. Implement survival controls for width/height, start/stop, and forward tunnel drilling with drops.

  3. Add the block’s texture, model, recipe, loot table, and English name.

Added the Tunnel Boring Rig mod. Craft the rig from iron ingots, rails, and a furnace; mine it with an iron pickaxe or better.

Use a stick on the rig to cycle its width (1–9 blocks); sneak and use a stick to cycle its height (1–6 blocks). Use it with an empty hand or another item to start or stop it. When running, it drills forward every 10 ticks, drops the blocks it removes, and stops at unbreakable blocks or blocks with inventories.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
16 390
src/main/java/dev/kodari/tunnelrig/TunnelRigMod.java
package dev.kodari.tunnelrig;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.minecraft.block.AbstractBlock;
import net.minecraft.block.Block;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;

public final class TunnelRigMod implements ModInitializer {
    public static final String MOD_ID = "tunnelrig";

    public static final TunnelRigBlock TUNNEL_RIG = Registry.register(
            Registries.BLOCK,
            new Identifier(MOD_ID, "tunnel_rig"),
            new TunnelRigBlock(AbstractBlock.Settings.create()
                    .strength(4.0f, 6.0f)
                    .requiresTool()
                    .sounds(BlockSoundGroup.METAL))
    );

    public static final BlockEntityType<TunnelRigBlockEntity> TUNNEL_RIG_BLOCK_ENTITY = Registry.register(
            Registries.BLOCK_ENTITY_TYPE,
            new Identifier(MOD_ID, "tunnel_rig"),
            BlockEntityType.Builder.create(TunnelRigBlockEntity::new, TUNNEL_RIG).build(null)
    );

    public static final Item TUNNEL_RIG_ITEM = Registry.register(
            Registries.ITEM,
            new Identifier(MOD_ID, "tunnel_rig"),
            new BlockItem(TUNNEL_RIG, new Item.Settings())
    );

    @Override
    public void onInitialize() {
        ItemGroupEvents.modifyEntriesEvent(RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier("functional_blocks")))
                .register(entries -> entries.add(TUNNEL_RIG_ITEM));
    }
}