Rudolph

Develop a Minecraft plugin that integrates with Google to allow players to type in a house design and have it automatically generate in-game. The plugin should support various architectural styles, provide options for customization, and include an intuitive GUI for selecting designs. Additionally, implement permissions for different user roles and a cooldown feature to prevent spam.

Kodari AI
KodariSep 22 at 7:34 pm 1
GoogleHouseGenerator
GoogleHouseGenerator is a Minecraft plugin that lets players type a house design description and automatically generate the structure in-game using Google's search and image recognition APIs. It supports multiple architectural styles like modern, Victorian, cottage, and futuristic, with customization options for size, materials, and complexity. The plugin features an intuitive inventory-based GUI where players can browse generated designs, preview them, and select one to build. A permission system defines roles such as player, builder, moderator, and admin, controlling who can generate, place, or manage designs. A cooldown system prevents spam by limiting generation frequency per player, with configurable durations and bypass permissions for higher roles. The plugin integrates Google Custom Search JSON API to fetch design references and converts them into block layouts using a procedural generation algorithm.
  1. Create the Paper plugin, configuration, and Google Gemini API integration.

  2. Add a GUI for architectural styles and size/material customization, plus chat-based design prompts.

  3. Add role-based build limits, permissions, and generation cooldowns.

Created GoogleBuild, a Paper 1.20.4 plugin that sends player descriptions to Google Gemini and places the returned block plan in-game. It includes a GUI for eight architectural styles, material palettes, and build dimensions, plus generation permissions, an architect size role, and a configurable cooldown.

Add your Google AI Studio API key to google.api-key in config.yml. Players can use /design to open the menu or /design generate <description> to generate directly; admins can reload settings with /design reload.

Rudolph

But it is for Android

Kodari AI
KodariSep 22 at 7:37 pm 1
  1. Convert the project from a Paper plugin into an Android app, keeping the house-design prompt, style/customization controls, and Gemini integration.

Converted the project into a native Android app with a prompt form, style/size/material selectors, and direct Gemini API requests. The API key is saved in the app’s local preferences.

The app currently generates a Minecraft house blueprint; it does not place blocks directly into a Minecraft world. Direct placement on Android would need a Bedrock add-on or an import workflow. Server-style roles and permissions also don’t carry over to this standalone app, and the Android version does not yet include a generation cooldown.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 363
src/main/java/com/kodari/googlebuild/MainActivity.java
package com.kodari.googlebuild;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.InputType;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.Spinner;
import android.widget.TextView;

import org.json.JSONArray;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class MainActivity extends Activity {
    private static final String PREFERENCES = "googlebuild_preferences";
    private static final String API_KEY = "gemini_api_key";
    private static final String GEMINI_ENDPOINT =
            "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash:generateContent";

    private final ExecutorService executor = Executors.newSingleThreadExecutor();
    private final Handler mainHandler = new Handler(Looper.getMainLooper());
    private EditText promptInput;
    private EditText apiKeyInput;
    private Spinner styleInput;
    private Spinner sizeInput;
    private Spinner paletteInput;
    private Button generateButton;
    private TextView statusText;
    private TextView resultText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(createScreen());
        apiKeyInput.setText(preferences().getString(API_KEY, ""));
    }

    private View createScreen() {
        ScrollView scrollView = new ScrollView(this);
        scrollView.setFillViewport(true);
        scrollView.setBackgroundColor(Color.rgb(247, 248, 252));

        LinearLayout content = new LinearLayout(this);
        content.setOrientation(LinearLayout.VERTICAL);
        content.setPadding(dp(20), dp(24), dp(20), dp(32));
        scrollView.addView(content);

        TextView title = new TextView(this);
        title.setText("GoogleBuild");
        title.setTextColor(Color.rgb(33, 45, 75));
        title.setTextSize(28);
        title.setTypeface(null, android.graphics.Typeface.BOLD);
        content.addView(title);

        TextView subtitle = new TextView(this);
        subtitle.setText("Turn an idea into a Minecraft-ready house plan.");
        subtitle.setTextColor(Color.rgb(92, 101, 120));
        subtitle.setTextSize(15);
        addView(content, subtitle, 0, 8);

        addLabel(content, "DESIGN PROMPT");
        promptInput = new EditText(this);
        promptInput.setHint("Describe the house you want...");
        promptInput.setGravity(android.view.Gravity.TOP | android.view.Gravity.START);
        promptInput.setMinLines(4);
        promptInput.setPadding(dp(12), dp(12), dp(12), dp(12));
        promptInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE
                | InputType.TYPE_TEXT_FLAG_CAP_SENTENCES);
        addView(content, promptInput, 0, 6);

        addLabel(content, "ARCHITECTURAL STYLE");
        styleInput = addSpinner(content, new String[]{
                "Modern", "Victorian", "Cottage", "Medieval", "Japanese", "Futuristic", "Rustic"
        });

        addLabel(content, "BUILD SIZE");
        sizeInput = addSpinner(content, new String[]{
                "Small · 12 × 10 blocks", "Medium · 16 × 14 blocks",
                "Large · 20 × 18 blocks", "Grand · 24 × 22 blocks"
        });

        addLabel(content, "MATERIAL PALETTE");
        paletteInput = addSpinner(content, new String[]{
                "Oak and stone", "Spruce and cobblestone", "Quartz and glass",
                "Dark oak and brick", "Cherry wood and sandstone", "Let Gemini choose"
        });

        addLabel(content, "GEMINI API KEY");
        apiKeyInput = new EditText(this);
        apiKeyInput.setHint("Paste your Google AI Studio API key");
        apiKeyInput.setSingleLine(true);
        apiKeyInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
        apiKeyInput.setPadding(dp(12), dp(10), dp(12), dp(10));
        addView(content, apiKeyInput, 0, 6);

        TextView keyNote = new TextView(this);
        keyNote.setText("Your key is saved only on this device and sent directly to Google.");
        keyNote.setTextColor(Color.rgb(105, 112, 128));
        keyNote.setTextSize(12);
        addView(content, keyNote, 0, 4);

        generateButton = new Button(this);
        generateButton.setText("Generate house plan");
        addView(content, generateButton, dp(48), 18);
        generateButton.setOnClickListener(view -> generatePlan());

        statusText = new TextView(this);
        statusText.setTextColor(Color.rgb(77, 87, 109));
        statusText.setTextSize(14);
        addView(content, statusText, 0, 12);

        resultText = new TextView(this);
        resultText.setTextColor(Color.rgb(40, 47, 64));
        resultText.setTextSize(15);
        resultText.setTextIsSelectable(true);
        resultText.setPadding(dp(14), dp(14), dp(14), dp(14));
        resultText.setBackgroundColor(Color.WHITE);
        addView(content, resultText, 0, 8);

        return scrollView;
    }

    private void generatePlan() {
        String prompt = promptInput.getText().toString().trim();
        String apiKey = apiKeyInput.getText().toString().trim();
        if (prompt.isEmpty()) {
            statusText.setText("Describe your house before generating a plan.");
            return;
        }
        if (apiKey.isEmpty()) {
            statusText.setText("Add your Google AI Studio API key to continue.");
            return;
        }

        preferences().edit().putString(API_KEY, apiKey).apply();
        String style = styleInput.getSelectedItem().toString();
        String size = sizeInput.getSelectedItem().toString();
        String palette = paletteInput.getSelectedItem().toString();
        generateButton.setEnabled(false);
        statusText.setText("Generating your house plan…");
        resultText.setText("");

        executor.execute(() -> {
            try {
                String plan = requestPlan(apiKey, prompt, style, size, palette);
                mainHandler.post(() -> {
                    resultText.setText(plan);
                    statusText.setText("House plan generated.");
                    generateButton.setEnabled(true);
                });
            } catch (Exception exception) {
                String message = exception.getMessage() == null ? "Request failed." : exception.getMessage();
                mainHandler.post(() -> {
                    statusText.setText(message);
                    generateButton.setEnabled(true);
                });
            }
        });
    }

    private String requestPlan(String apiKey, String description, String style, String size, String palette)
            throws Exception {
        String instructions = "Create a practical Minecraft house blueprint from this request. "
                + "Return readable plain text with sections: Concept, Dimensions, Materials, "
                + "Floor plan, and Build steps. Include a compact top-down ASCII floor plan for each floor, "
                + "label its orientation, and give clear block-placement guidance. Keep the design within "
                + "the selected dimensions.\n"
                + "Architectural style: " + style + ".\n"
                + "Maximum footprint: " + size + ".\n"
                + "Material palette: " + palette + ".\n"
                + "Player's description: " + description;

        JSONObject part = new JSONObject().put("text", instructions);
        JSONArray parts = new JSONArray().put(part);
        JSONObject content = new JSONObject().put("parts", parts);
        JSONObject request = new JSONObject().put("contents", new JSONArray().put(content));

        HttpURLConnection connection = (HttpURLConnection) new URL(GEMINI_ENDPOINT).openConnection();
        connection.setRequestMethod("POST");
        connection.setConnectTimeout(15000);