Project

Saro's AI Chat

Integrate Google Gemini directly into Minecraft for intelligent, context-aware conversations and optional agentic command execution.

Header

Overview

Saro's AI Chat brings the power of Google Gemini 2.0 Flash into your Minecraft world. It's not just a chatbot; it's a context-aware companion that knows where you are, what time it is, and what the weather is like. With optional "Cheat AI" enabled, it can even act as an admin assistant, executing commands on your behalf.

Overview

Key Features

๐Ÿค– Intelligent Chat

  • Powered by Gemini 2.0 Flash: Uses Google's latest and fastest Gemini model for natural, logical responses.
  • Memory: The AI remembers conversation context per player. Reset it anytime with !clear.
  • Markdown Support: Chat messages support bold, italics, code blocks, headings (H1-H3), and lists.
  • Multilingual: Automatically responds in German or English based on your input.

๐ŸŒ Context Awareness (Player Data Collection)

The AI isn't flying blind. It collects and knows:

  • Player Name: Knows your name and addresses you directly.
  • Position: Current X/Y/Z coordinates.
  • Biome: Automatically detects your current biome.
  • Health & Hunger: Shows hearts and hunger level.
  • Minecraft Time: Current in-game day and time.
  • Weather: Clear, rain, or thunderstorm.
  • Experience Level: Your current XP level.
  • Game Mode: Survival, Creative, Adventure, or Spectator.
  • Inventory: First 10 items in your inventory.

๐Ÿ’ก Tip: Ask the AI "What biome am I in?" or "Show me my stats" to get information about yourself.

โšก Cheat AI Mode (8 Command Types)

Enable enableCheatAI in the config to unlock full power.

โš ๏ธ Warning: Cheat AI mode gives the AI access to powerful server commands. Only for trusted environments!

When enabled, the AI can perform the following actions on natural language requests:

Command Type Example Request What Happens
Give Items "Give me 64 diamonds" [GIVE:diamond:64] โ†’ /give
Remove Items "Remove my sword" [REMOVE:item:1] โ†’ /clear
Clear Inventory "Clear my inventory" [CLEAR_INVENTORY] โ†’ /clear
Kill Player "Kill me" [KILL] โ†’ /kill
Apply Effects "Give me speed" [EFFECT:speed:60:2] โ†’ /effect give
Change Weather "Make it sunny" [WEATHER:clear] โ†’ /weather
Set Time "Make it day" [TIME:6000] โ†’ /time set
Any Command "Spawn 10 zombies" [COMMAND:summon zombie] ร— 10

๐Ÿ”ง Special Features

  • Multi-Summon: AI can spawn multiple entities at once (up to 50).
  • Relative Coordinates: Supports ~ coordinates for commands.
  • Bracket Fixing: Automatic correction of unbalanced brackets in commands.
  • Error Handling: Clear error messages for API issues.

Commands

Command Description
!clear Resets chat context (AI forgets previous conversation)

Configuration

Located in config/sarosaichatmod-common.toml.

[api]
    # Get your free key at aistudio.google.com
    geminiApiKey = "YOUR_KEY_HERE"

[chat]
    # Enables/Disables AI responses to chat messages
    respondToTextMessages = true

[features]
    # DANGEROUS: Allows AI to execute server commands!
    # Can give items, clear inventory, kill player, change weather, etc.
    enableCheatAI = false

Configuration Options

Option Default Description
geminiApiKey "YOUR_GEMINI_API_KEY_HERE" Your Google Gemini API key
respondToTextMessages true Whether the AI responds to chat messages
enableCheatAI false Enables powerful command execution

Technical Details

  • API: Google Gemini 2.0 Flash (gemini-2.0-flash)
  • HTTP Client: Java 11+ HttpClient for async requests
  • Temperature: 0.7 (balanced creativity)
  • Max Tokens: 1000 per response
  • Player Data: Persistently saved in config/ai_player_data.json

Installation

  1. Install Forge for Minecraft 1.20.1.
  2. Download the mod and place it in the mods folder.
  3. Start Minecraft once to generate the config.
  4. Visit aistudio.google.com and create a free API key.
  5. Enter the key in config/sarosaichatmod-common.toml.
  6. Optional: Enable enableCheatAI for extended features.

Note: This wiki serves as documentation. For active discussion, please join the Discord Server.

Featured

Need a Custom Mod?

Concept to code. I build professional, optimized mods tailored to your exact specifications.

Hire me on Fiverr โ†’