2023-08-15 23:39:02 -07:00
# Mindcraft
2024-01-30 22:26:27 -06:00
Crafting minds for Minecraft with ChatGPT and Mineflayer
2023-08-15 23:39:02 -07:00
2024-01-30 22:26:27 -06:00
#### ‼️Warning‼️
2024-01-30 16:43:30 -06:00
2024-01-30 22:26:27 -06:00
This project allows an AI model to write/execute code on your computer that may be insecure, dangerous, and vulnerable to injection attacks on public servers. Code writing is disabled by default, you can enable it by setting `allow_insecure_coding` to `true` in `settings.json` . Enable only on local or private servers, **never** on public servers. Ye be warned.
2024-01-30 16:43:30 -06:00
2024-01-30 22:26:27 -06:00
## Requirements
2024-01-30 16:43:30 -06:00
2024-01-30 22:26:27 -06:00
- [OpenAI API Subscription ](https://openai.com/blog/openai-api )
2024-02-17 16:42:10 -06:00
- [Minecraft Java Edition ](https://www.minecraft.net/en-us/store/minecraft-java-bedrock-edition-pc )
2024-01-30 22:26:27 -06:00
- [Node.js ](https://nodejs.org/ ) (at least v14)
2024-01-30 16:43:30 -06:00
2023-08-15 23:39:02 -07:00
## Installation
2024-01-30 22:26:27 -06:00
Add `OPENAI_API_KEY` (and optionally `OPENAI_ORG_ID` ) to your environment variables
2023-08-15 23:39:02 -07:00
2024-01-30 16:43:30 -06:00
Clone/Download this repository
2023-08-15 23:39:02 -07:00
2024-01-30 16:43:30 -06:00
Run `npm install`
2023-08-15 23:39:02 -07:00
2024-02-17 16:42:10 -06:00
Install the minecraft version specified in `settings.json` , currently supports up to 1.20.2
2024-01-30 22:26:27 -06:00
## Run
2024-01-30 16:43:30 -06:00
2024-01-30 22:26:27 -06:00
Start a minecraft world and open it to LAN on localhost port `55916`
2024-01-30 16:43:30 -06:00
Run `node main.js`
2024-01-30 22:26:27 -06:00
You can configure details in `settings.json` . Here is an example settings for connecting to a non-local server:
2024-01-30 16:43:30 -06:00
```
{
2024-02-01 16:16:30 -06:00
"minecraft_version": "1.20.1",
2024-01-30 16:43:30 -06:00
"host": "111.222.333.444",
"port": 55920,
"auth": "microsoft",
"allow_insecure_coding": false
}
```
2023-11-27 21:07:52 -06:00
2023-12-04 21:33:40 -06:00
## Patches
2023-11-27 21:07:52 -06:00
2024-02-17 16:42:10 -06:00
Some of the node modules that we depend on have bugs in them. To add a patch, change your local node module file and run `npx patch-package [package-name]`