Plugin Version: 1.4 | API Version: 3.0-pre |
NSR-AI v1.4 is the most significant update for developers and server owners to date. This release transforms NSR-AI from a standalone tool into a full-fledged Development Platform — featuring a completely rebuilt programmatic API, granular AI controls, a powerful chat interception layer, and deep stability hardening across every system in the codebase. Whether you're a server admin who wants plug-and-play reliability, or a developer building on top of NSR-AI, this update delivers.
| Area | What's New |
|---|---|
| 🆕 New Features | Privacy system, Pet API, session control, command routing, middleware, and more |
| 🐛 Bug Fixes | Several critical, security, pet, and engine stability fixes |
| ⚡ Optimization | Major RAM reduction, CPU hardening, and full codebase consolidation |
| 🛠️ Developer API | Builder-pattern registration, async futures, interceptors, RAG access |
🆕 New Features · 🐛 Bug Fixes & Stability · ⚡ Performance & Optimization · 🛠️ Developer API
NSR-AI v1.4 completely decouples the AI engine from the Minecraft main thread, keeping your server running smoothly at all times.
askAI and sendMsg now run entirely in the background — your server stays at 20 TPS even during complex AI reasoning.SaveMsg or updating the Knowledge Base no longer causes disk lag or server hiccups.CompletableFuture, giving developers precise control over when to handle AI responses without blocking the game thread.NSR-AI 1.4 introduces a powerful Interceptor System that allows addons to sit between the player and the AI, enabling custom processing at every stage of a conversation.
Addons can now register an AIInterceptor to:
knowledge.yml store directly.read-knowledge and edit-knowledge nodes control access globally and per-addon.onSystemPrompt interceptor to append dynamic instructions to the /ai global system prompt.askAI or sendMsg, the core NSR-AI system prompt is bypassed, allowing the addon to supply its own pure system instructions./aia)/aia <AddonName>, keeping /ai exclusively for core features..onTabCompleteHandler() for rapid development.With great power comes great responsibility. NSR-AI 1.4 adds a multi-layered permission system to keep your server secure.
permissions.yml allows admins to disable chat reading or editing for all addons at once.permissions.yml for every registered addon.read-player-input, edit-ai-response, cancel-player-input, and more.The internal engine has been upgraded with intelligent routing logic that handles multi-provider setups seamlessly.
Developers now have granular control over how the AI remembers and forgets across conversations.
You no longer have to reload the entire plugin for a small change. The new API supports targeted reloads for any component:
| Mode | What It Reloads |
|---|---|
FULL | Everything |
CONFIG | config.yml only |
KNOWLEDGE | RAG knowledge base only |
FEATURES | Feature toggles only |
Take full control over the AI engine programmatically, without ever restarting the server.
NSR-AI 1.4 overhauls how addons integrate commands into the server, providing a clean, collision-free namespace.
/aia, leaving /ai exclusively for core plugin features./aia aps).NSR-AI 1.4 introduces a robust privacy layer that gives players full control over their data.
/ai opt in to enable maximum privacy. This swaps sensitive information (like Player Names and IPs) with random codes (e.g. PlayerName → R2d13n) before sending data to the AI. It also blocks all addon and plugin access to the player's chat, preventing any middleware from reading or editing their AI interactions./ai opt <in|out> allows players to toggle between modes instantly.To ensure a smooth transition from older versions, NSR-AI v1.4 retains 100% backward compatibility for all core chat addons from v1.2 and v1.3 (AIMessage & AIResponse systems).
NSR-AI 1.4 has been hardened with several critical stability and security fixes across all major systems.
/ai reload. All other addons remained as ghost instances in memory, causing duplicates, memory leaks, and unpredictable behavior after every reload.429 Too Many Requests errors to cascade to players. Now properly consults the OverloadedKeyManager before selecting a key.***a1b2).registerPlugin() and registerAddon() accepted any plugin or addon without checking the security ban list, allowing a banned addon to bypass restrictions by registering programmatically. Both methods now validate against SecurityManager before granting access.validatePlugin() to SecurityManager so entire Bukkit plugins (not just addons) can be banned. The API bridge is severed at runtime with a clear log warning, and the fix is fully backward compatible with older security JARs.CopyOnWriteArrayList to prevent ConcurrentModificationException during asynchronous AI processing.NullPointerException crash when chat logging was disabled in config but players were actively chatting.clearApiKeys() call that was causing unnecessary overhead on player disconnect.Due to significant usage spikes observed recently, we have overhauled our update and security infrastructure to ensure 100% uptime and reliability.
validatePlugin and validateAddon in SecurityManager. Banned plugins are now disconnected at registration time, preventing unauthorized API access.ConcurrentHashMap to prevent ConcurrentModificationException during async API operations.PlayerListener to respect privacy settings — players who opt out of privacy will no longer have their chat logged by the global ChatLogger./v1/models for OpenAI).CopyOnWriteArrayList for consistent thread-safe history management.onDisable for Knowledge Base and Saved Chats to ensure zero data loss during server restarts.ChatLogger key masking to eliminate an O(N×M) bottleneck. The logger no longer scans every player's key for every message — it now targets only relevant keys, drastically reducing CPU usage on large servers.ConcurrentHashMap for fail-safe async cleanup.CopyOnWriteArrayList to prevent broadcast crashes.-pre, -alpha) without numeric parsing errors.AdminRecipientManager to handle manual configuration errors gracefully.PetListener chat processing to only scan relevant pets, eliminating O(N) server-wide scans and preventing chat-induced TPS drops. Implemented Regex Pattern caching on the Pet object itself to prevent thousands of expensive regex recompilations during chat events.PetDataStorage and Pet inventory handling. The server no longer creates empty Bukkit Inventory objects in memory for every loaded pet — inventories are now fully lazy-loaded on demand, saving significant heap memory on servers with large numbers of pets.PetManager to ConcurrentHashMap (replacing unsafe HashMap instances) and implemented ThreadLocal date formatting in PetDataStorage. This entirely eliminates the risk of ConcurrentModificationException during async pet chat processing./ai pet (share, link-redeem, unlink), bridging the gap between command usage and backend logic.ConcurrentHashMap and thread-safe data structures. This eliminates the risk of ConcurrentModificationException during high-frequency AI interactions.synchronized file locks for all YML and Binary storage managers. This prevents data corruption during simultaneous async AI responses and ensures player settings, API usage counts, and chat histories are always saved correctly.AddonManager to eliminate expensive temporary file creation/deletion when scanning addon JARs. Metadata is now read directly from the JAR stream via InputStreamReader, removing a major source of disk I/O lag and preventing file-lock errors.Addon interface as @Deprecated to streamline the v1.5 transition while maintaining full v1.4 backward compatibility.URLClassLoader and JarFile handles are closed properly.ConfigUpdater with try-with-resources for default configuration streams, preventing stranded file descriptors during repeated plugin reloads.StandardCharsets.UTF_8 for all configuration and addon metadata reading, ensuring consistency across different server locales.ConfigUpdater to be additive-only, safely preserving custom user keys and data across version upgrades.com.nsr.ai.plugin.data package (14 legacy DAO classes). This unused skeleton code is now archived, preventing accidental compilation, reducing the final JAR size, and shrinking the overall codebase footprint.ItemStack inventory caching from the PlayerData object. Data is now fetched directly from the online player only when needed, reducing heap memory usage by up to 90% on high-player-count servers.KnowledgeManager search logic to perform direct iteration, eliminating expensive HashMap copying on every query.Gson and OkHttpClient as shared, high-performance singletons across all managers.onPlayerMove) to ensure the plugin has zero idle CPU overhead for non-AI tasks.PlayerDataManager and ConversationManager to ensure all data is persisted with atomic safety during async operations.ConcurrentHashMap cache for PBKDF2 key derivation in EncryptionUtil and SecurityUtil, eliminating massive CPU spikes during data decryption and player-specific key generation.ChatLogger to use ThreadLocal<SimpleDateFormat>, preventing thousands of unneeded object allocations per minute during heavy logging.MessageFormatter with StringBuilder, significantly reducing memory fragmentation and garbage collection pauses.SecureRandom and ThreadLocalRandom usage for faster generation. Lifted invariant string transformations out of loops in StringUtil and pre-compiled Regex patterns in UpdateChecker for tighter execution.animationFrame tracking map from ActiveConversationManager. By utilizing localized closure state within the BukkitRunnable, thousands of auto-boxing memory allocations and map mutation operations that previously occurred every second during active AI conversations are now eliminated.OkHttpClient and Gson instantiations, routing requests through the plugin's global singletons to eliminate duplicate thread pools.SHOP_QUERY_PATTERN), stripping a heavy Pattern.compile() call out of the high-frequency chat event path.final, guaranteeing immutability and enabling JVM memory access optimizations for addon metadata DTOs.API Version: 3.0-pre | Fully backward compatible with v1.2 and v1.3 addons.
NSR-AI 3.0-pre replaces the old, complex registration system with a modern, builder-pattern API that makes integration effortless. All critical paths are async-first, giving developers full control without blocking the game thread.
Register your extension with a single line of code. NSR-AI handles all the complex reflection and internal logic automatically.
// Register a native NSR-AI addon
NSRAI.getAPI().registerAddon(myAddon);
// Register an existing Bukkit plugin that wants AI features
NSRAI.getAPI().registerPlugin(myPlugin, myAddon);
registerAddon(AIAddon) — For native NSR-AI extensions.registerPlugin(Plugin, AIAddon) — For existing Bukkit plugins that want to add AI features.You no longer have to settle for the default AI "brain." Developers can programmatically adjust how the AI thinks for each specific request:
presence_penalty) directly into the JSON request body.All API calls are fully non-blocking. Use standard Java CompletableFuture chains to handle responses cleanly.
api.askAI(player, "What is the weather today?")
.thenAccept(response -> player.sendMessage(response))
.exceptionally(err -> { err.printStackTrace(); return null; });
// Read from the knowledge base
String info = api.getKnowledge("server-rules");
// Write to the knowledge base
api.setKnowledge("server-rules", "No griefing allowed.");
Requires the read-knowledge / edit-knowledge permissions to be granted to your addon in its permissions.yml.
// Summarize a player's conversation history
api.summarizeChat(player);
// Clear a player's conversation session
api.clearSession(player);
// Access shared memory between addons
api.getSharedMemory().put("my-key", "my-value");
api.registerInterceptor(new AIInterceptor() {
@Override
public String onPlayerInput(Player player, String input) {
return input.replace("badword", "***"); // Edit input before it hits the AI
}
@Override
public String onAIResponse(Player player, String response) {
return "[MyAddon] " + response; // Add branding to responses
}
});
// Override the model for a single request
AIRequest request = new AIRequest(player, "Summarize this:")
.withModel("gemini-1.5-pro")
.withProvider(AIProvider.GEMINI);
api.askAI(request).thenAccept(player::sendMessage);
Developer-First. Admin-Controlled. Hardened Security. Effortless Integration. NSR-AI 1.4 — The Platform for Intelligence. 🎮 ⚡ 🧠
Welcome to the next evolution of server-side intelligence. NSR-AI v1.3 is a high-performance middleware architecture designed to bridge the gap between advanced Large Language Models (LLMs) and the Minecraft environment. This update is not just a feature drop; it is a fundamental shift toward precision control, latency masking, and adaptive memory engineering.
We have re-engineered the communication layer to give you granular control over the AI's generation stream.
[Stop] interrupts the display stream only. Because the request has already been sent to the API provider, tokens are still consumed. Think of it like canceling a broadcast; the signal was already sent, you just stopped listening.[Edit] button acts as a "Time Machine." It instantly pulls your last message back into your chat bar so you can fix typos or tweak your instructions without retyping the whole paragraph.[Regenerate] and choose a new "Brain Mode": Detailed, Simple, Default, Creative, or Concise. The AI will try again with a different perspective.Say goodbye to AI "hallucinations" (when AI makes things up).
knowledge.yml file before it speaks. It extracts facts about your server lore, rules, or shop prices and uses them as a "cheat sheet" to give 100% accurate answers./ai chatYour interactions are more than just text—they are serialized data structures that define your server's lore.
/ai chat save <name> to immortalize complex role-play narratives. This saves the AI's current memory state, not just the text./ai chat resume) lets you jump back to a previous part of the conversation. If a narrative goes wrong, you can "rewind" to a specific checkpoint and try a different path.We have moved beyond primitive history limits. The AI now manages its own "attention span" to stay sharp.
Context: 24%)./aiaNSR-AI 1.3 functions as a Micro-Kernel platform. The core handles the intelligence, while the extensions handle the gameplay mechanics.
/aia command portal is your "Control Center." Manage all modular add-ons like AFK Trackers, Player Stats, or Economy Bridges from one place.Powering your world with intelligence that is Complex Inside, Simple Outside.
Unmatched Power. Zero-Lag Performance. Hardened Security. Effortless Control.
NSR-AI 1.3: Elevate Your Protocol. 🎮⚡🧠
NSR-AI v1.2.1 Patch Update ⚙️ Critical Hotfix for AI Response & Message Sender Module
A new maintenance release is rolling out: NSR-AI 1.2.1. This patch delivers major stability improvements by fixing two core issues inside the nsr-ai-api layer:
🔧 Fixed Issues
AI Response Handler Bug Some users on v1.2 experienced delayed or incomplete AI replies. This has been fully resolved with optimized pipeline handling.
AI Message Sender Error Outgoing AI messages were failing under certain player data states. This patch stabilizes the message dispatch flow for all players.
🔄 Auto-Update Policy (Important)
Players currently on NSR-AI v1.2 will receive an automatic bug-fix update to v1.2.1. This is a targeted patch. Auto-update applies ONLY to v1.2 users. Earlier versions remain unaffected, as the bug existed exclusively in the 1.2 build.
🛡️ Stability Boost. Cleaner Logs. Smoother AI.
NSR-AI 1.2.1 ensures a more reliable in-game AI experience, sharper message delivery, and fewer interruptions. Your server AI just leveled up.
💬 Powering your world with smarter gameplay.
Welcome to a smarter, more resilient NSR-AI! This update introduces a highly advanced API Key Management system, designed for ultimate control, security, and flexibility, alongside the groundbreaking NSR-AI Open-Source Addon API and significant enhancements to the Pet System.
The entire API key, pet, API, and configuration systems have been thoroughly modified to enhance security, efficiency, and speed.
Error [Code]: [Name]. Suggestion: [Fix]. Player-specific errors are shown only in-game, keeping the console clean./ai help command now provides detailed descriptions for all commands and subcommands, making it easier for users to understand plugin functionalities.The entire key system has been rebuilt from the ground up, now consolidated under the powerful /ai apikey command.
When you type /ai apikey, you will now see these instructions:
/ai apikey store <projectId>. This command will convert your most recently added session key into a permanent stored key, associating it with the provided <projectId>./ai apikey, then type store-<your_api_key>. The system will automatically generate a unique Project ID for it.NSR-AI now automatically rotates through your available API keys for each request. This distributes the load and maximizes uptime.
Use /ai apikey info <key-id> to see a detailed breakdown of your key's performance.
ACTIVE): The key is valid and ready, waiting in the wings.USING): This is the key currently processing your AI requests.OVERLOADED): The key is temporarily rate-limited. The system will automatically skip it and try again later.LIMIT_REACHED): The key has hit a hard usage limit (e.g., daily/monthly quota) and will be skipped until the quota resets.INACTIVE): The key is invalid or has an error (e.g., wrong model, or other error ). It will not be used until it is changed to the active through timer reset.A new command has been added to manually clear the overloaded status of an API key.
/ai apikey timer <key-id> removeA new command allows for the removal of unwanted or corrupted API keys.
/ai apikey clear <all|projectId>projectId or clear all your API keys. This is particularly useful for removing corrupted, expired, or unused keys, helping to maintain a clean and efficient API key management system.When you add a key, NSR-AI instantly detects the provider (Google, Anthropic, OpenAI) and assigns a suitable default model, streamlining the setup process.
/ai apikey fallback global <true|false>false. The plugin will stop if your key fails.Players now have granular control over whether their AI chat conversations are saved to the plugin's logs.
/ai apikey msg save <true|false>true, chat messages (excluding API key entry messages) will be logged.false, chat messages will not be logged.false (chat history saving is disabled by default for enhanced privacy).The plugin now features a robust chat logging system designed for clarity, organization, and session tracking.
playerchathistory and adminchathistory) within the plugin's data directory.chat-MM-dd-yyyy.log.chat-MM-dd-yyyy-1.log, chat-MM-dd-yyyy-2.log), providing clear separation of chat sessions.store-<your_api_key>) are strictly excluded from all chat logs to ensure maximum security and prevent sensitive information leakage.pet folder under the player's name (if enabled).While API keys are entered via chat, the plugin now employs advanced filtering to ensure that messages containing API keys (both global and player-specific) or those used for direct API key storage (store-<your_api_key>) are never written to the plugin's chat history logs. This provides an additional layer of security, preventing sensitive information from being inadvertently recorded.
globalKeyFailMessage (defined in features.yml) is displayed to the player in-game.All apikey commands feature a clean, professional "cyber-console" theme, making the interface intuitive and stylish.
A small disclaimer has been added to the /ai help command, informing users that some commands might be misconfigured or have incorrect descriptions based on server settings.
config.yml, including the admin-activation-code and global API keys, are now automatically encrypted. The plugin intelligently encrypts new plain-text values on reload, so you can safely add or change keys in the config file./ai admincode command to safely view the current admin activation code. This code is now generated automatically if it's not set in the config.This update addresses several critical issues to enhance the plugin's reliability and security:
config.yml, features.yml, etc.) were not being applied correctly after a /ai reload command, despite the plugin reporting a successful reload. The reload system now accurately updates all relevant settings.bug.txt is now at: plugins/NSR-AI/security/bug.txtbugfix.reloading is now at: plugins/NSR-AI/security/bugfix.reloadingreserved-nicknames.yml is now at: plugins/NSR-AI/pets/reserved-nicknames.ymldeath_log.yml is now at: plugins/NSR-AI/pets/death_log.ymlThis update empowers you with a robust and transparent key management system. We can't wait for you to experience the new level of control and reliability!
NSR-AI is built with a security-first mindset. The plugin employs a multi-layered strategy to protect sensitive data, particularly player API keys. This section details the core components of our security framework.
These files are the foundation of the plugin's encryption system and are located in the plugins/NSR-AI/security/ directory.
master_secret.conf: This file contains a unique, randomly generated secret value. It acts as the primary seed for generating the server's main encryption key. Never share this file.server.salt: This is a random value used to add complexity to the encryption process, making it more resistant to pre-computation attacks (like ✨ tables). It ensures that even if two servers had the same master secret, their final encryption keys would be different.master.key: This is the final, derived Server Master Key. It is generated by combining the master_secret.conf and the server.salt. This is the key that performs the second layer of encryption on all stored API keys.When a player stores an API key using /ai apikey store or the store-<key> format, it is never saved in plain text. Instead, it undergoes a robust, three-layer encryption process.
Storage Location: Stored keys are saved in the plugins/NSR-AI/player_keys/<player_uuid>/ directory. Each player has their own dedicated folder, named after their unique player ID (UUID). Within this folder, individual API keys are stored in separate .yml files, named after their Project ID (<project_id>.yml). This player-specific folder also contains the player's unique master.key and salt.bin files, which are crucial for deriving their Player Master Key.
Layer 1: Key-Specific Encryption:
userKey) is derived from a combination of the player's UUID and the key's Project ID.userKey. This means every single stored key has its own unique first layer of protection.Layer 2: Player-Specific Master Key Encryption:
master.key and salt.bin files, adding a crucial layer of individual security.Layer 3: Server-Wide Master Key Encryption:
master.key)..yml file.Integrity Verification (Hashing):
This multi-layered approach ensures that API keys are exceptionally secure. An attacker would need to compromise the server to get the master.key, server.salt, master_secret.conf, and know the specific player's UUID and Project ID to even begin to decrypt a single key.
We are thrilled to announce the open-sourcing of the NSR-AI Addon API! This new API layer transforms NSR-AI into a powerful platform, allowing developers to create rich, integrated addons without directly modifying the core plugin. It provides a secure and stable bond, enabling addons to interact with key functionalities, much like a dedicated communication channel.
To maintain NSR-AI's security, stability, and integrity, certain functionalities remain exclusively within the core plugin and are not exposed via the Addon API:
This update brings significant new features and improvements to the pet system, making your companions more interactive and personalized.
/ai pet inv./ai pet to view details about your active pet.level, xp, health, hunger, and mood.A groundbreaking feature allowing players to share access to their pets with friends, fostering a more social and interactive pet experience.
/ai pet share):
/ai pet share <pet_name>: Generates a link requiring owner acceptance./ai pet share <pet_name> allow: Generates a link for immediate access./ai pet share <pet_name> <relationship>: Generates a link with a custom relationship, requiring owner acceptance./ai pet share <pet_name> <relationship> allow: Generates a link with a custom relationship, immediate access./ai pet <link_code>): Players use this to activate links, triggering access or acceptance requests./ai pet removefriend, /ai pet relation):
/ai pet removefriend <player_name> <pet_name>: Owner removes a friend's access./ai pet relation <pet_name> <player_name> <new_relationship>: Owner changes a friend's relationship./ai pet link list: Shows your own pets that are linked with other players./ai pet linked list: Shows other players' pets that are linked with you./ai pet unlink <pet_name>): Friends can voluntarily remove their own access to a pet./ai pet inv allow|disallow <pet_name> <player_name> command to allow or disallow specific players to access a pet's inventory.The /ai data command has been completely re-engineered into a sophisticated, hybrid AI system that seamlessly blends conversational AI with a precise, local knowledge base search. This new approach provides more accurate, context-aware answers while significantly optimizing API usage.
This system operates on a multi-step principle known as Retrieval Augmented Generation (RAG):
Intent Recognition & Retrieval: When you ask a question like /ai data hey who is the owner of this plugin?, the system doesn't just send your message to the AI. First, it intelligently analyzes your message to identify the core question ("who is the owner of this plugin?"). It then uses this core question to perform a highly targeted search within the knowledge.yml file, retrieving only the most relevant pieces of information.
Augmented Generation: Next, the system constructs a new, highly-detailed prompt for the main AI. This prompt includes your original, full message along with the specific, relevant information retrieved from the knowledge base. This acts as a "cheat sheet" for the AI, giving it the exact facts it needs to answer your question correctly.
Natural, Contextual Response: Finally, the AI processes this combined information and generates a single, natural-sounding response that incorporates both the conversational elements of your original message and the factual data from the knowledge base. The result is a fluid answer like, "Hello! The owner of the NSR-AI plugin is BlackForge."
This advanced process ensures that you get the most accurate and relevant answers, drawn directly from the server's custom knowledge, while preventing the high costs and potential inaccuracies of sending large, irrelevant amounts of data to the AI.
Get ready to connect with your beloved Minecraft pets like never before! Version 1.2 of NSR-AI introduces the Pet Emotional Communication System, a revolutionary feature that brings your tamed companions to life with unique personalities, moods, and the ability to chat with you.
/ai pet tame command while looking at a tamed and named pet to link it to the AI. This will allow your pet to start communicating with you./ai pet nickname <nickname>. Each pet's nickname must be unique!/ai pet list: See a list of all your linked pets and their status./ai pet info <pet_name>: Get detailed information about a specific pet, including its mood, bond level, and more./ai apikey command./ai apikey: then type the key in the chat to add a temporary API key for your session./ai apikey list: View your active session keys (masked for security)./ai apikey clear: Remove all your active session keys./ai pet tame./ai pet nickname <nickname> to give your pet a unique nickname.We are incredibly excited for you to try out the new Pet Emotional Communication System and form a deeper bond with your furry (and feathery) friends!
NSR-AI now includes a robust, automated system to keep your plugin secure and up-to-date with the latest bug fixes. This system operates silently in the background, ensuring your server benefits from continuous improvements and protection without manual intervention for updates.
bug.txt file tracks the installed bug-fix version, preventing redundant downloads and ensuring efficient updates.This ensures your NSR-AI experience is always stable, secure, and running the latest enhancements.

Gemini + ChatGPT Powered AI Chat for Minecraft: Fast, Smart & Server-Friendly