A robust Node.js application that automatically generates a Minecraft economy price.yml using minecraft-data (Version 26.1.2) and an AI model (via OpenAI API or Ollama) to logically price items.
- Recipe Engine: Recursively parses recipe crafting matrices to deduce base item costs.
- Relative Pricing: Bases everything off
DIAMOND = $200as the standard anchor. - AI Economy Balancer: Calculates Rarity Modifiers, Utility Modifiers, and creates prices for uncraftable items (like dirt, nether stars) based on your formula:
Base Price = (Recipe Cost × Rarity Modifier × Utility Modifier). - Standard Compliant: Exports to
price.ymlperfectly adhering to theMATERIAL_NAME: PRICEstandard detailed inprice-file-standard.md.
-
Install Dependencies (Already done for you):
npm install
-
Configure AI (.env): Open the
.envfile and configure your AI settings.If using OpenAI:
OPENAI_API_KEY=sk-your-openai-key OPENAI_BASE_URL=https://api.openai.com/v1 MODEL=gpt-4o # Or gpt-3.5-turbo
If using Ollama (Local AI):
OPENAI_BASE_URL=http://localhost:11434/v1 MODEL=llama3 # Or whichever model you have pulled
If using Ollama Cloud:
OLLAMA_API_KEY=your-api-key-from-ollama.com MODEL=gpt-oss:120b # Or any model from https://ollama.com/search?c=cloud
Get your API key from: https://ollama.com/settings/keys
-
Run the Generator:
node index.js
This will output price.yml when complete, adhering to the standard you requested.
To use Ollama Cloud models with this generator:
- Create an account at https://ollama.com
- Generate an API key at https://ollama.com/settings/keys
- Check available cloud models at https://ollama.com/search?c=cloud
- Update
.env:OLLAMA_API_KEY=your-api-key MODEL=gpt-oss:120b # or any cloud model
- Run
node index.js
The generator automatically detects Ollama Cloud and uses the native Ollama API with proper authentication.