Have you ever wanted ChatGPT to control your Minecraft world? Yes? Well then this is the perfect project for you! Simply download the mod, set up an OpenAI api key, set it to your system environment variable "OPENAI_API_KEY" and then launch the mod! This will cost money overtime, however the amount is extremely small (less than a cent every minute or so) but there are things that will increase or decrease it, as detailed below. There are several settings, all of which can be accessed through the /gptmc command.
Commands
- /gptmc godmode <enable|disable|status> (Enables, disables, and gets the status of God Mode, which is what allows ChatGPT to control your world. By default it is on.)
- /gptmc morals <get|set|clear> (Gets, sets, and clears the "morals" of God Mode, which is what ChatGPT sees as right and wrong)
- /gptmc minimumevents <get|set|reset> (To save on money from the API key, a system is set up to not send anything to OpenAI if no events or a number of events fewer than this number have been triggered. The default number is 3)
- /gptmc summary <get|clear> (The summary is a report generated by a second AI, which summarizes the recent events and sends them to ChatGPT. However, after a while this summary can get very large, and the larger it is, the more money it costs; so it is highly recommended to clear it once in a while)
- /gptmc interval <get|set> (This will change the interval at which information is summarized and sent to ChatGPT. The lower the number is, the faster and more expensive it is. By default it is set to 30 seconds)
- /gptmc prompt (This command can only be run with God Mode disabled, and will just allow you to access ChatGPT from Minecraft like you would through the website)
- /gptmc help (Displays all commands and their syntax)
- /gptmc debug <response|summary> (Enables reports of the summary or response generated by ChatGPT)
Events
Events are like triggers that activate whenever a certain action is performed. Currently the events used allow for reading chat, detecting when entities are hit, and detecting when blocks are mined.
Actions
ChatGPT has several actions, which it can choose from based on the choices made by players. It may reward or punish players based on what they do. Currently, the memory system for ChatGPT is slightly broken, so it may punish / reward players multiple times for only one action. Its actions are as follow:
- say: Sends a message to all players on the server
- give: gives an item to a player
- smite: strikes a player with lightning
- clear: clears a player's inventory
- lightning: strikes a player with lightning repeatedly until they die
- whisper: sends a message to only one player
- effect: gives a player an effect
- time: sets the time to day or night
- heal: sets a player's health and hunger to full
Disclaimers & Warnings
I do not own OpenAI (if I did I wouldn't be making this mod) or any companies affilliated with it. This mod is entirely open-source and on GitHub. ChatGPT cannot be entirely controlled and will have a degree of randomness, so it is not recommended to use this in a world you play on regularly.
90% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+