Minecraft Chatbot with Forge

Published on: May 4th, 2025

Project Overview

This project involved creating a custom chatbot inside Minecraft using the Forge modding framework. The chatbot listens to in-game commands, responds contextually, and can even analyze the player's gear and determine if the player should fight the mob.

The chatbot is activated by simplying just typing in the chatbox or with the use of two commands "/keywords" triggers the hardcoded set of keywords that is predefined and once prompting that question will reply with the answer and "/analyzegear" triggers such as “can I fight [mob name]” and uses the Groq API to determine if a player can handle a mob with the gear they have equipped before responding. This project taught me how to integrate game events with external AI APIs, opening up endless possibilities for interactive mods.

How It Works

The Forge mod listens to chat input and responds when a player when they type into the chat or asks a recognized question in the keyword list. If the user uses the "/analyzegear" command it will then scan you equipped items send it to the groq api and determine if you should engage or upgrade before engaging the mob.

The mod uses the Groq API to analyze the player's gear and provide feedback on whether they are adequately equipped to face a specific mob. The Groq API is a powerful tool that can analyze images and provide insights based on its training data.

It uses a plugin wrapper for Groq API calls, and logic to assess whether it’s safe to engage the mob based on the players own equipment and groqs training on minecraft mobs.

It also just naturally scans the chatbox for anything thats typed to send to the groq api for a chatbot conversaion.

Installation & Setup

MUST HAVE INSTALLED
  1. JDK version 17 or higher (this mod uses JDK 17)
  2. A copy of Minecraft (if you wish to test with your own copy)
  3. Forge 1.20 (if testing with your Minecraft installation)
  4. An IDE like IntelliJ, Eclipse, or VS Code
  5. Groq API Key
If You DO Own Minecraft / Want to Test With Your Copy:
  1. Download Forge 1.20 from this link
  2. Click "Download Installer"
  3. Double-click the downloaded `.jar` and choose "Install Client"
  4. Open %appdata% and go to the .minecraft folder
  5. If a mods folder doesn’t exist, create one
  6. Add groqchatbot-1.0.0.jar to the mods folder
  7. Launch Minecraft using the Forge 1.20 profile
  8. Once the game loads, the mod should be active and ready to use
If You DO NOT Own Minecraft / Want to Test in Dev:
  1. Extract all files
  2. Import the project into your Java IDE (IntelliJ recommended)
  3. Wait for Gradle to finish its setup
  4. In Gradle tasks, navigate to forgegradle runsgenIntellijRuns (or your IDE’s equivalent)
  5. Wait for the project to build
  6. Run the runClient task
  7. Once Minecraft opens, verify the mod under the “Mods” menu
  8. Launch a new world for testing (personally using creative is the best option)
  9. Use chat commands to interact
  10. Type /keywords to list the hardcoded keywords with set replies
  11. Type /analyzegear monstername to prompt AI analysis (replace monstername)
  12. If you modify keywords, repeat step 5 to rebuild

Technologies Used

  • Language: Java
  • Platform: Minecraft Forge (1.20.1)
  • IDE: IntelliJ IDEA
  • API Integration: Groq AI Vision

Key Features

  • Custom command parsing using Minecraft chat events
  • Integration with Groq API for real-time analysis
  • Expandable command system

Challenges and Lessons

One of the main challenges was synchronizing real-time Minecraft data with external API calls. I had to learn about asynchronous programming in Java, Forge event hooks, and safely manipulating Minecraft client state.

This project significantly improved my understanding of game modding, event-driven programming, and API integration within game clients.

Conclusion

The Minecraft Chatbot was a fun and technically rewarding project that connected gameplay with modern AI capabilities. It showcases how modding can be enhanced by external services, as well as how far minecraft modding as come.