Compatibility
Minecraft: Java Edition
Platforms
Supported environments
75% of ad revenue goes to creators
Support creators and Modrinth ad-free with Modrinth+Creators
Details
AI NPCs
AI-NPC Launcher is a Minecraft mod that launches and controls the AI-NPC client, enabling you to create and interact with NPCs that can move, mine, and chat with players in the game. This mod serves as the launcher for the AI-NPC client, which powers the actual NPC functionality. Currently, the AI-NPC's capabilities include basic movement, mining actions, and chatting with players.
Note: This project is under active development. Future updates will expand the NPCs capabilities.
Requirements
- Minecraft Version: 1.20.4 (support for newer minecraft versions coming soon)
- Dependencies: FabricAPI and java 17
- Running Ollama server or an openAi api-key (instructions are below)
Installation
-
Download the Mod:
-
Install the Mod:
- Place
AI-NPC Launcher
in yourmods
folder on the server (from version 1.0.4).
- Place
-
Launch Minecraft:
- Start Minecraft client with the 1.20.4 version to load the mod.
- (v1.0.1-alpha) The client will auto connect to localhost:25565
Usage
(Player must be operator to execute these commands)
-
Set Configuration:
- Use the
/setconfig <propertyKey> <propertyValue>
command to set the properties. (Example:/setconfig npc.llm.openai.api_key sk-proj-XYZ...
)
- Use the
-
Spawn NPCs:
- Use the
/npc add <npcname> <isOffline> <openai|ollama> <llm model>
command to create an NPC. (Example:/npc add sailex428 true openai gpt-4o-mini
) (at this point only openai is supported)
- Use the
-
Remove NPCs:
- Use the
/npc remove <npcname>
command to remove an NPC from the game world.
- Use the
-
Interact with NPCs:
- Just write in the chat to interact with the NPCs.
Setting Up LLM Integration
Option 1: OpenAI API Key (Paid)
-
Create an Account:
- Sign up or log in to OpenAi
-
Purchase Credits:
- Navigate to Billing
- Add a payment method and add credits to your balance
-
Generate an API Key:
- Navigate to api-keys
- Click on the top right on "Create new secret key"
- Copy the api-key
-
Add the API Key to the Mod:
- Use
/setconfig npc.llm.openai.api_key <your_api_key>
in-game to set the key.
- Use
Option 2: Ollama (Local LLM)
What is Ollama?
Ollama is a local LLM platform for running AI models directly on your machine, reducing reliance on external APIs.
Installation Steps
-
Download Ollama:
- Visit Ollamas Website and download the installer for your operating system.
-
Install and Run Ollama:
- Follow the setup instructions to install.
- Download a model (i recommend the gemma2 model)
- Start Ollama and ensure it's running in the background.
-
Connect to the Mod:
- Use the
/npc add
command withollama
as the model type. - Example:
/npc add npcname true ollama gemma2
- if your server runs on a diffrent address you can set that via
/setconfig npc.llm.ollama.url <youre server address>
.
- Use the
Development Status
This project is under development, and additional features will be released over time. Upcoming features may include combat skills and more interactions like crafting.
License
This project is licensed under the LGPL-3.0.