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. 🎮 ⚡ 🧠

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