pythonguylol

Develop a free AI chat plugin for Paper 1.21.11 that allows players to interact with a local AI by using the command /ai <message>. The plugin should feature configurable AI responses, support for multiple languages, and the ability to customize the AI's personality through a simple configuration file, all without requiring external APIs or additional plugins.

Kodari AI
KodariJan 21 at 12:18 pm 10,835 (v2)

I’ll create a local AI chat plugin with pattern-based responses, configurable personality, and multi-language support.

LocalAIChat
A Paper plugin that provides players with an interactive local AI chat experience using the /ai command. Features intelligent pattern-based responses, configurable personality traits, multi-language support, and context-aware conversations. No external APIs required - all responses are locally generated using customizable pattern matching and response templates. Players can have natural conversations with adjustable AI personality characteristics.

Your LocalAIChat plugin is complete! Here’s what I’ve created:

Core Features: ✅ Pattern-based AI response system (no external APIs) ✅ Configurable personality (name, friendliness, humor, formality, verbosity) ✅ Multi-language support (English, Spanish, German) ✅ Context-aware conversations (remembers last 5 messages) ✅ Time awareness and emoji support ✅ Customizable response patterns via YAML

Files Created:

  • Main plugin class with command registration

  • AI Response Engine with pattern matching

  • Configuration and Language managers

  • Conversation context tracking

  • 50+ default response patterns covering greetings, questions, jokes, etc.

Commands:

  • /ai <message> - Chat with AI

  • /ai clear - Reset conversation

  • /ai reload - Reload configs

Configuration: The plugin includes extensive customization through config.yml (personality traits), responses.yml (pattern/response pairs), and language files for internationalization.

Build with gradle build and the plugin is ready to use!

pythonguylol

like an actual model running locally with no extra downloads

Kodari AI
KodariJan 21 at 12:20 pm 13,617 (v2)

I can see this is currently a pattern-matching chatbot. I’ll transform it into a true local AI model using a lightweight neural network that runs entirely in Java with zero external dependencies.

Plan:

  • Create a simple but functional neural network (feedforward with backpropagation)

  • Implement word embedding and tokenization

  • Add training capability from conversation data

  • Replace pattern matching with actual ML inference

  • Keep it lightweight and fast

Done! I’ve transformed this into a real local AI model with:

Neural Network Components:

  • 3-layer feedforward network (input → hidden → output) with ReLU activation

  • Backpropagation training with cross-entropy loss

  • Softmax output for multi-class classification

NLP Pipeline:

  • Custom tokenizer with vocabulary building

  • Word embeddings (64-dimensional vectors)

  • Sequence encoding with padding

Features:

  • Trains on startup from your response patterns (50 epochs)

  • Saves/loads trained model to disk (no retraining needed after first run)

  • /ai retrain command to retrain the model

  • Runs 100% locally in Java - zero external dependencies

  • Async processing to avoid server lag

The AI learns to classify messages into categories and selects appropriate responses. It’s a genuine machine learning model, not pattern matching!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
Code
19 1,458
src/main/java/com/localai/LocalAIChat.java
package com.localai;

import com.localai.commands.AICommand;
import com.localai.engine.AIResponseEngine;
import com.localai.managers.ConfigManager;
import com.localai.managers.LanguageManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class LocalAIChat extends JavaPlugin {
    
    private ConfigManager configManager;
    private LanguageManager languageManager;
    private AIResponseEngine responseEngine;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        configManager.loadConfigs();
        
        this.languageManager = new LanguageManager(this);
        languageManager.loadLanguages();
        
        this.responseEngine = new AIResponseEngine(this);
        responseEngine.loadResponses();
        
        getCommand("ai").setExecutor(new AICommand(this));
        
        getLogger().info("LocalAIChat has been enabled!");
        getLogger().info("AI Personality: " + configManager.getPersonalityName());
    }
    
    @Override
    public void onDisable() {
        if (responseEngine != null) {
            responseEngine.clearAllContexts();
        }
        getLogger().info("LocalAIChat has been disabled!");
    }
    
    public void reload() {
        configManager.loadConfigs();
        languageManager.loadLanguages();
        responseEngine.loadResponses();
    }
}