Skip to content

rushyaayt/AlchemistMC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

AlchemistMC

AlchemistMC a modder client.

Prerequisites

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

The Complete Implementation:

Save the following script as mc_ai_modder.py.

Optional

How to Set Up and Use

1. Configure the Environment

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"

2. Run the Command

Pass the name, an ID, and the exact natural language description of what you want built.

Example A: Simple Item

./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."

Example B: Complex Logic / Blocks

./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."

How it works under the hood

  • 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.

How to Run and Output a .jar File

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."

About

AlchemistMC a modder client.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages