AlchemistMC a modder client.
Before running the tool, ensure your Linux environment has the following installed:
- 1 Python 3.10+ * Java Development Kit (JDK) 17 or 21 (Required for modern Minecraft compilation)
- 2 An OpenAI API Key
# Install JDK 17 (Ubuntu/Debian example)
sudo apt update
sudo apt install openjdk-17-jdk python3-pip -y
Save the following script as mc_ai_modder.py.
Ensure your executable script has permissions and export your OpenAI API key:
chmod +x mc_ai_modder.py
export OPENAI_API_KEY="your-actual-api-key-here"
Pass the name, an ID, and the exact natural language description of what you want built.
./mc_ai_modder.py \
--name "Blaze Sword" \
--id "blazesword" \
--desc "Add a custom sword named 'Blaze Sword' that ignites targets for 5 seconds upon hitting them and grants the player fire resistance while held."
./mc_ai_modder.py \
--name "Vibranium Ore" \
--id "vibranium" \
--desc "Add a new deepslate ore block called Vibranium. When mined, it drops Vibranium Crystals. If a player walks on raw Vibranium ore without boots, give them a levitation effect for 2 seconds."
- 1 Structured Outputs: The pipeline forces the AI model to reply utilizing OpenAI's structured JSON formats. Instead of parsing messy markdown text responses, it directly yields file paths and exact code string mappings.
- 2 Fabric API Scaffolding: It generates standard Fabric environments, injecting correct configuration keys into a temporary fabric.mod.json.
- 3 Local Compiling Execution: The script dynamically launches a system subprocess invoking the Gradle build system (./gradlew build). Gradle resolves missing cloud dependencies, compiles the Java source code generated by the LLM, checks for structural syntax errors, and zips the contents into a verified, clean .jar archive ready to throw straight into a .minecraft/mods directory.
Ensure you have a JDK (Java Development Kit) installed on your Linux machine so the system can run compilations:
# Verify you have javac installed
javac -version
# Set permissions and provide your OpenAI Key
chmod +x mc_ai_modder.py
export OPENAI_API_KEY="your-api-key-here"
# Execute the tool
./mc_ai_modder.py --name "Void Pickaxe" --id "voidpick" --desc "A custom netherite-tier pickaxe that automatically smelts blocks mined, converting iron ore blocks straight into iron ingots."