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.

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