krvxoo

I want a minecraft mod which basically auto builds stuff for me. So if I say /build house, it will just build a house, if I say /build stash, it will auto build a stash

Kodari AI
KodariJun 21 at 5:14 pm 13
AutoBuilder
A Fabric 1.21.11 mod that automatically builds predefined structures on command. Use /build house to construct a fully furnished house, or /build stash to build a hidden underground stash room. Structures are placed block-by-block with a satisfying animation effect. Supports building rotation based on player facing direction, and checks for valid flat space before building.

Now I have everything I need. Let me plan the mod:

  • AutoBuilderMod.java — main initializer, registers commands

  • BuildCommand.java — /build <structure> command with tab completion

  • StructureBuilder.java — ticks block placements from a queue

  • StructureDefinitions.java — hardcoded block layouts for house and stash

  • BuildTask.java — data class holding a pending build session

AutoBuilder
A Fabric 1.21.11 mod that automatically builds predefined structures on command. Use /build house to construct a cozy house, or /build stash to place a hidden underground storage room. Blocks are placed one-by-one in a smooth wave animation. Structures are rotated to face the player and the mod checks for enough clear space before starting.

Here’s what was built:

Files created:

  • build.gradle + gradle.properties — standard Fabric 1.21.11 setup

  • fabric.mod.json — mod manifest

  • AutoBuilderMod.java — registers the command + hooks the server tick event

  • BuildCommand.java — /build <structure> with tab completion

  • StructureDefinitions.java — hardcoded blueprints for house and stash

  • BuildTask.java — tracks per-player build progress

  • StructureBuilder.java — tick loop that places 2 blocks/tick, bottom-to-top wave

How it works:

Command
Result
/build house
7×7 oak house with log frame, glass pane windows, a door, crafting table, and slab roof
/build stash
5×5 underground stone brick room with a chest, torch, and dirt/grass disguise on top

Structures spawn 2 blocks in front of you, automatically rotated to face your direction. Blocks are placed 2 per tick in bottom-to-top order for a satisfying build-up animation. If you run /build while one is in progress it’ll tell you to wait.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
Code
8 513
src/main/java/com/autobuilder/AutoBuilderMod.java
package com.autobuilder;

import com.autobuilder.command.BuildCommand;
import com.autobuilder.build.StructureBuilder;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class AutoBuilderMod implements ModInitializer {
    public static final String MOD_ID = "autobuilder";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        BuildCommand.register();
        ServerTickEvents.END_SERVER_TICK.register(server -> StructureBuilder.tick(server));
    }
}