Перейти к содержимому
Mineforgian

Kilacraft-AI

The first plugin that gives every server an AI Agent that understands you better the more you use it

Загрузки
64
Подписчики
3
Обновлён
11 июля 2026 г.
Лицензия
MIT

Опубликован 27 апреля 2026 г.

Kilacraft-AI

The first plugin that gives every server an AI agent that understands you better the more you use it — powered by LLM intent recognition and skill execution framework

GitHub Tag MC Java License Discord


Version Compatibility

Minimum Requirements: Minecraft 1.16.5 + Java 17

Minecraft Version Java Requirement Supported Servers
1.16.5 Java 17+ Paper / Purpur / Leaf / Folia
1.17 - 1.19 Java 17+ All
1.20 - 1.21+ Java 21+ All

One JAR compatible with all versions. Developed on Spigot 1.16.5 API, fully supports Folia regional thread scheduling.

Optional Dependencies

Plugin Version Features
CMI 9.8.6.4+ Teleport, homes, warps, enhanced player info, TPA
GlobalMarketPlus 1.3.8.0+ Market queries, balance, prices, listings
MythicMobs 5.12.0+ NPC placeholders (display AI responses)
Vault Latest Multi-currency support
Spark Latest Server performance sampling & analysis (Paper 1.21+ etc. have it built-in)

Features auto-disable when plugins are missing. Core chat remains unaffected.


Quick Start

1. Install

Download the latest Kilacraft-AI.jar, place it in your server's plugins/ directory, and start the server.

2. Configure API

Edit plugins/Kilacraft-AI/llm.yml with your LLM API credentials:

llm:
  api_url: "https://api.deepseek.com/v1/chat/completions"
  api_key: "your-api-key"
  model: "deepseek-chat"

Supports all OpenAI-compatible providers (DeepSeek, Zhipu AI, Moonshot, OpenAI, Groq, SiliconFlow, Gemini, OpenRouter, etc.). Just change api_url and model to switch.

3. Test

/kila hello

If you see an AI response, you're all set.

Reload config with /kilacraft reload, knowledge base with /kilacraft knowledge reload, personalities with /kilacraft personalities reload.


Core Features

AI Smart Chat

CHAT output

ACTION_BAR output

BOSS_BAR output

SIDEBAR output

Three Interaction Modes:

# Command mode
/kila How do I get diamonds?

# Continuous chat mode
/kilacraft chat
> I want to build a farm
> AI: Great idea! What crop do you want to plant?

# Keyword trigger (public chat)
@ai How do I craft this?

Command aliases: /kilacraft, /kila, /ai, /zm

Streaming Output & Carriers:

AI responses display character by character in real-time, eliminating wait. Supports 5 output carriers, configurable per scenario:

Carrier Effect Best For
SIDEBAR Right sidebar, no FOV obstruction Long responses (recommended)
BOSS_BAR Top bar Medium-length text
ACTION_BAR Above hotbar Short notifications
CHAT Chat box Default
TITLE Screen center Short highlights

AI Response Sound:

Plays a sound when AI starts responding, only the triggering player hears it. Configured in output.yml:

output:
  sound:
    enabled: true
    sound_name: "ENTITY_PLAYER_LEVELUP"
    volume: 0.5
    pitch: 1.2

Knowledge Base Enhancement

Let AI understand your server rules, gameplay, and FAQ. Just place Markdown or TXT files in plugins/Kilacraft-AI/knowledge/:

# server_rules.md

## How to claim land?
Use the /claim command to define your territory. Costs at least 10 coins.

Run /kilacraft knowledge reload to load. AI automatically retrieves and cites relevant content when players ask questions. Supports custom dictionaries for server-specific terminology to improve search accuracy.

Knowledge base file

Knowledge base configuration file

knowledge base retrieval


Advanced Features

Player Profile & Social Relations

Player Profile: AI automatically analyzes player conversation history and builds an eight-dimension behavioral profile for each player, dynamically injecting profile summaries as reference context in subsequent conversations. AI gets smarter about your players over time.

Player Profile

Dimension Description Example
Playstyle Gameplay preferences Combat-oriented, Explorer, Builder
Personality Behavioral patterns Friendly, Humorous, Direct
Interests Liked areas and activities Economy & trading, Redstone, Building
Boundaries Disliked content or behaviors Don't use my name, Don't rush me
Communication Preferred AI response style Brief & direct, No emojis
Spatial Memory Mentioned locations, base positions Main base at desert (1200,64,-800)
Known Facts Explicitly stated facts by the player Steve is a friend, Home near desert temple
Special Observations AI freeform observations "This player has recently shown interest in enchanting"

Automatically triggers analysis on player login/logout (triple gate mechanism to prevent wasting API calls). Configured in llm.yml:

agent:
  profile:
    enabled: true
    min_interval_minutes: 30    # Minimum analysis interval
    min_message_delta: 20       # Minimum new message count

Social Relations: Automatically tracks interactions between players (private messages, TPA, skill interactions), building a social relationship graph. Relationship strength uses diminishing incremental algorithm — inactive relationships naturally decay over time.

  • Friends' milestone events (boss kills, raid completions, pet deaths, etc.) appear in each other's login greetings
  • AI can sense "who's friends with whom" and naturally mention friend dynamics in conversations

Social Relationship System

Effect of social relationship system

Login Greeting

AI automatically sends personalized greetings when players log in. Based on player profiles, offline events, and friend dynamics, every greeting is unique.

First Login: Welcomes new players with an introduction to AI assistant features. Supports custom server info (configured via server_info in greeting.yml).

AI Greetings System Configuration File

AI greeting system effectiveness

Returning Login (Three-Category Data Aggregation):

Category Data Source Example
Own Events Events that happened while player was offline Items sold, payments received
Friend Dynamics Friends' milestones during offline period Friend killed the Ender Dragon
Session Highlights Important events since last greeting Pet killed, totem triggered, Warden defeated

AI returns to greeting system effectiveness

Personality System & NPC Dialogue

Define different AI personality styles in personalities.yml, and with MythicMobs, NPCs can have independent personalities and dialogue capabilities:

common_prompt: "You are an NPC on a Minecraft server, talking to player {player}."

Fox: |
  You are a clever fox NPC who speaks playfully and cutely.
  Likes to end sentences with "~", often uses emojis.

NPC Dialogue Methods:

Method 1 (Callback Command, recommended):

fox_npc_skill:
  Skills:
  - cmd{c="kilacraft plugins Fox What are the server rules <caster.uuid> myplugin handle_ai {response} <caster.name>"} @self

Method 2 (MythicMobs Placeholder):

fox_npc_skill:
  Skills:
  - cmd{c="kilacraft plugins Fox What are the server rules <caster.uuid>"} @self
  - message{msg="<caster.ai.answer{type=Fox}>"} @trigger

Plugin commands are console-only. Each UUID_personality combination has independent history.

AFK Task System

Create background monitoring tasks via natural language. Automatically notifies or executes actions when conditions are met.

The first instance of the AFK task system

The first example demonstration of the AFK task system

Second instance of the AFK task system

Display of the second example of the AFK task system

Player: Watch for Steve to come online
AI: Got it! I'll notify you as soon as Steve logs in.

[30 minutes later...]
🔔 Steve has joined the server!
Player: Watch for Steve to come online, then check what he's holding
AI: Will do! I'll automatically check Steve's item when he logs in.

[After Steve joins...]
🔔 Steve is online! He's holding a Diamond Sword x1 in main hand.

Supports 20 monitoring types (19 event listeners + custom polling):

Monitor Type Description
Player Join/Quit Monitor specific player online status
Player Death/Respawn Monitor death events and respawns
Player Teleport/World Change Monitor position changes
Level Change Monitor player level ups/downs
Weather Change Monitor world weather
Sleep/Item Break Enter/leave bed, item breakage
Fishing Notify or trigger actions on catch
Chat Trigger automation via keywords
Block Break Trigger actions when specific blocks mined
Entity Death Boss kill detection
Entity Spawn Mob farm efficiency monitoring
Entity Explosion Anti-grief warning
Furnace Smelt Notify when smelting completes
Crop Growth Notify when crops mature

Custom Condition Polling — Monitor any numeric condition returned by Skills:

Player: Tell me when my health drops below 10
Player: Remind me when my balance goes below 1000
Player: Check diamond price when I reach level 30

Management: /kilacraft afk to view, /kilacraft afk cancel to cancel. One task per player at a time.

Server Health Monitoring

Real-time server performance monitoring and AI-powered diagnostics based on Spark. A daemon thread runs 24/7 in the background with automatic anomaly detection and alerting.

Automatic Monitoring: The daemon thread polls TPS/MSPT/CPU metrics every 10 seconds. When thresholds are exceeded, it automatically launches Spark Profiler sampling, then calls the reasoning model to generate a diagnostic report upon completion.

Manual Profiling: Use for proactive troubleshooting:

/kilacraft profile start [30-120]    # Start profiling (seconds)
/kilacraft profile status            # View status
/kilacraft profile stop              # Abort and discard

Diagnostic Reports: Includes server status overview, plugin timing and hot method trigger paths (self time), AI diagnostic conclusions and optimization recommendations. Reports are saved in plugins/Kilacraft-AI/reports/ permanently.

AI Report

Alert Notifications: Supports in-game notifications + Discord Webhook / DingTalk bot external push (automatic mode only). Use /kilacraft notify test to test notification channels.

Discord Notice

Historical Queries: Query historical alerts and reports via natural language:

  • "What alerts have there been in the past day?"
  • "List recent diagnostic reports"
  • "I upgraded MythicMobs yesterday, check if performance has improved"

Full configuration guide in admin.yml. Requires Spark plugin + reasoning model API key. Paper 1.21+/Folia/Purpur/Leaf/Pufferfish have Spark built-in.

Player Behavior Analysis

Query your server's player ecosystem via natural language. Permission: kilacraft.admin.player.

  • Online Trends: "What's the player online trend this week?" — Login/logout time distribution
  • Activity Rankings: "Show the most active players leaderboard" — Login count, playtime, last login
  • New Player Influx: "How many new players joined this week?" — Count and time distribution
  • Profile Coverage: "How many players have AI profile analysis?" — Analyzed/pending count
  • Social Insights: "Show player social network analysis" — Total relations, average strength, isolated players
  • Specific Player Social Relations: "Check Steve's social relations" — Detailed social relations, strength, interaction frequency for a specific player

Audit Log Query

Query AI skill usage via natural language. Permission: kilacraft.admin.audit.

  • Execution Records: "Query what skills player Steve has used" — Skill name, parameters, results
  • Usage Statistics: "Show skill usage statistics leaderboard" — Usage count, success/failure, avg duration
  • Error Tracking: "Show failed skill execution records" — Failure records, error messages, time distribution

AI Skill System

AI interacts with the server through Skills, each corresponding to a category of operations. All Skills are read-only queries (except explicitly marked write operations), with fine-grained permission control.

Capabilities Overview

Category Capabilities Dependency Permission Node
Bukkit API 72 built-in read-only interfaces: player inventory/status/info, world info, server info, environment awareness None kilacraft.api.*
Vanilla Stats 80+ vanilla cumulative stat queries, knowledge base BM25 retrieval, auto unit conversion None kilacraft.bukkit_stats
Global Market Search/list/collect/buy-order/delist/transfer/auction/bulk-sell/bulk-buy (9 operations) GlobalMarketPlus kilacraft.market.*
CMI Integration 5 queries (home/warp/player info/online/AFK) + 3 teleports CMI kilacraft.cmi.*
AFK Tasks 19 event listeners + custom polling, natural language creation, notification/callback dual mode None kilacraft.afk
Utility Timed delay, proactive notification, server-wide broadcast None
Command Execution Execute commands as player, inherits permission system (disabled by default) None kilacraft.command.execute
Sound & Particles AI-triggered sounds/particles, only caller perceives, YAML-driven config None kilacraft.bukkit_fx
Server Admin Health monitoring, player analysis, audit logs (see Advanced Features above) Spark (optional) kilacraft.admin.*

Wildcards kilacraft.api.* and kilacraft.cmi.* include all sub-permissions respectively.

Products listed on the global market

Global market balance transfer

Confirmation of Global Market Balance Transfer


Data & Security

Data Persistence

Supports both H2 embedded database (default, zero-config) and MySQL. Data persists across restarts. MySQL recommended for multi-server data sharing. Hot-switch with /kilacraft reload, auto-fallback on failure.

Data Description
Conversation History All player-AI conversations, batch flushed every 30 seconds
Player Profiles Eight-dimension behavioral analysis results
Social Relations Interaction strength and type between players
Server Events Milestone events like deaths, achievements, trades
Skill Audit All Skill execution logs
Profile Snapshots Profile historical versions

Data retention days configurable in database.yml. Expired data is automatically cleaned up. Group server data isolation.

Security

  • Player Data Isolation: Built-in non-cooperative security filter scans all Skill parameter values — non-self, non-whitelisted player names are automatically replaced (sanitization)
  • Third-Party Skill Protection: Even if a third-party Skill attempts to operate on other players, the security filter automatically sanitizes inputs
  • Skill Global Registry: Usage statistics and security review status of all registered third-party Skills at Skill Global Registry. Reviewed Skills marked as Verified

Open SPI Interface

Third-party plugin developers can expose their features to AI via the Skill SPI interface:

  • API JAR only 5 KB (compileOnly dependency)
  • Implement SkillProvider interface to register custom Skills
  • Built-in error isolation — third-party Skill exceptions don't affect core functionality

See Skill SPI Integration Guide.


Commands & Permissions

Command List

Command Permission Description
/kilacraft <message> None Chat with AI
/kila /ai /zm None Aliases
/kilacraft chat None Toggle continuous chat mode
/kilacraft clear kilacraft.clear.self Clear own chat history
/kilacraft clear <player> kilacraft.clear.other Clear specified player's history
/kilacraft reload kilacraft.reload Reload config
/kilacraft knowledge reload kilacraft.knowledge Reload knowledge base
/kilacraft personalities reload kilacraft.personalities Reload personality config
/kilacraft afk kilacraft.afk View AFK tasks
/kilacraft afk cancel kilacraft.afk Cancel AFK task
/kilacraft tasks kilacraft.tasks View scheduled task status (default OP)
/kilacraft profile start [seconds] kilacraft.admin.health Start manual profiling
/kilacraft profile status kilacraft.admin.health View profiling status
/kilacraft profile stop kilacraft.admin.health Abort profiling and discard
/kilacraft notify test kilacraft.admin.health Test external notification channels
/kilacraft plugins ... Console only Third-party plugin integration

Skill Permissions

Permission Node Default Description
kilacraft.api.player.inventory true Query player inventory
kilacraft.api.player.status true Query player status
kilacraft.api.player.info true Query player info
kilacraft.api.world.info true Query world info
kilacraft.api.server.info true Query server info
kilacraft.cmi.query true CMI info queries
kilacraft.cmi.teleport true CMI teleportation
kilacraft.bukkit_fx true Sound & particle effects
kilacraft.bukkit_stats true Vanilla stats queries
kilacraft.command.execute op Command execution (OP only by default)
kilacraft.tasks op View scheduled task status (OP by default)
kilacraft.admin.health op Server health monitoring
kilacraft.admin.player op Player behavior analysis
kilacraft.admin.audit op Audit log query
kilacraft.admin.* op All admin features

Wildcards kilacraft.api.* and kilacraft.cmi.* include all sub-permissions respectively.


FAQ

Q: Is the API expensive?

With DeepSeek as an example, a single conversation costs approximately ¥0.001-0.002. Setting cooldown time (default 5 seconds) effectively controls costs.

Q: Which LLMs are supported?

All OpenAI-compatible providers. Regular conversations do not support thinking/reasoning models (like deepseek-reasoner, o1), but the admin features' AI diagnostics support configuring a reasoning model (in admin.yml).

Q: Will it lag the server?

No. All API requests are async. Memory usage 8-50 MB, HTTP connection pool reuse, supports streaming to reduce latency.

Q: How to update?

Back up plugins/Kilacraft-AI/ to preserve configs, replace the JAR, restart the server.


Community & Resources

Source Code

GitHub

Community

Discord

Documentation

English Wiki Skill Registry

Contributing

Issues PR

MIT License — If you find this useful, a ⭐ Star would be appreciated!

Ченджлог

2.1.3Релиз26.1.1, 26.1.2, 26.2 · 11 июля 2026 г.

v2.1.3 - Player Real-Time State Awareness, Greeting System Update Reminders, Version Info Query Skill, Knowledge-Base Retrieval Quality Boost, AI Request Resource Optimization & Security/Stability Hardening

✨ New Features

  • Built-in CLAUDE.md Reference: Starting with v2.1.3, the repository root includes a CLAUDE.md file for developers using AI coding tools for secondary development. Designed for Claude Code by default (auto-loaded every session), it covers the project architecture, i18n conventions, code conventions, key design constraints, and modification triggers. For other AI code tools (Cline, Cursor, Copilot Chat, etc.), copy the content into that tool's global rules or context file configuration equivalent
  • AI Real-Time Player State Awareness: The AI can now automatically sense the player's current state — coordinates, health and hunger, held items and worn armor, current world, weather, and time of day — without the player having to explain repeatedly or trigger extra skill queries. For state-dependent requests like "take me back", "can this mine diamonds?", or "is there a desert nearby?", the AI responds with context-aware answers and advice. Enabled by default for all players — fully automatic, zero-config, and stores no data
  • AI Login Greeting Proactively Notifies of New Versions: Long-running servers that are never restarted can still learn about plugin updates in time. When an admin with the kilacraft.admin.info permission logs in, the AI proactively mentions in the greeting whether a new version is available, stating the exact version number and download URL. Each version is announced to each admin only once — no repeated nagging. Network-check failures are handled silently without disrupting the normal greeting
  • Version Info Query Skill: Admins can now ask the AI about plugin version info in natural language — "is there a new version", "what did the latest version update", "what is the download URL", "what features does v2.1.0 have". The AI fetches version info from Gitee/GitHub in real time and answers with the version number, release date, download URL, and full changelog. Requires the kilacraft.admin.info permission (default OP)

🔧 Improvements

  • More Accurate Knowledge-Base Retrieval (highlight of this release): The BM25 algorithm now includes the IDF (Inverse Document Frequency) weight — rare, specialized keywords that appear in only a few docs rank higher, while ubiquitous generic words like "player" and "command" no longer dilute results. Recall accuracy of the default BM25 mode (used by the vast majority of servers) improves overall
  • More Reliable Knowledge-Base Hot Reload: After switching the server language or toggling Embedding semantic retrieval, /kila reload now automatically rebuilds the knowledge-base chunks, statistics, and vector cache — preventing cache/content mismatches that cause retrieval anomalies or slow responses
  • AI Request Resource Optimization: AI requests still in progress are automatically cancelled when a player goes offline, no longer continuing to drain API quota and server threads
  • Embedding Cache Concurrency: Concurrent queries from multiple players no longer serialize and wait on each other (more noticeable on large servers with Embedding enabled)
  • More Precise AI Error Hints: On a 404 error, the hint now distinguishes "model name may be incorrect" from "API URL may be incorrect", so server owners don't troubleshoot in the wrong direction
  • Faster Security Cache Cleanup on Huge Servers: Cleanup of the recent-active-player cache no longer slows down noticeably as the player count grows
  • More Traceable AFK Task Callbacks: When a callback can't be delivered because the player is offline, a console log is now recorded to help diagnose "the task didn't seem to fire"
  • Auditable Command-Type Skill Operations: Command-type skills executed as OP (e.g. /tpa <target>) keep their cross-player capability while now also logging an audit trail
  • More Reliable Server Anomaly Alert Notifications: Server performance anomaly alerts are now delivered to every authorized admin via the login greeting, instead of only the first one who comes online. Each alert is announced to each admin only once — no repeated nagging

🐛 Bug Fixes

  • Corrected the comment direction for the retrieval relative threshold (relative_threshold) in knowledge.yml — the old comment wrongly labeled "raise = stricter" as "raise = more lenient", which could lead server owners to tune in the wrong direction; default value unchanged
  • Hardened a defensive path that could cause a no-response hang when the secondary analysis hit an extreme exception before calling the AI
  • Fixed hot-reloading the output config occasionally causing individual replies to briefly land on the wrong display channel
  • Hardened the concurrency safety of AFK-task creation

⚠️ Compatibility

Upgrading from v2.1.2

  1. Stop server, replace JAR, start; no database migration needed
  2. Removed the deprecated console AI-chat entry: Chatting with the AI directly from the console via /kila <message> (an early debugging feature that became unusable as Agent capabilities grew — the console can't use most skills) has been fully removed. The console still keeps /kila plugins (third-party plugin integration), /kila doctor, /kila reload, /kila knowledge reload, and other management commands; the player side is completely unaffected
  3. This is a quality release: no new config entries, no permission changes, no database changes — fully backward compatible
  4. If you customized the knowledge.yml comments, you may regenerate it to get the corrected threshold notes (comment-only correction, no new config entries)
2.1.2Релиз26.1.1, 26.1.2, 26.2 · 26 июня 2026 г.

v2.1.2 - New In-Game Query & Diagnostic Commands (usage / history / memory / skills / run / doctor / about), Knowledge-Base Retrieval Refactor & AI Error Handling

✨ New Features

  • Corpus Seeding Dictionary: On startup, automatically scans the knowledge base for command names (e.g. /backback) and compound identifiers (e.g. mob-farm, ender-dragon) and adds them to the HanLP tokenizer dictionary. No manual dictionary maintenance — the knowledge base content server owners write is itself the best tokenization reference
  • Knowledge Base Writing Guide: The official Wiki provides ready-to-use knowledge-base writing templates (Chinese & English) — 7 writing rules + a complete usable sample; filling in per the template yields the best recall
  • BM25 Document Length Auto-Statistics: On startup, automatically computes the actual average length of knowledge-base chunks so BM25 scores long and short docs more fairly. Advanced users may set a fixed avg_doc_length (default 0 = auto)
  • In-Game Query & Diagnostic Commands: A set of commands for server owners and players to track AI usage and troubleshoot
    • /kila usage [player|all] [range]: AI usage stats (conversation turns, skill-call count & success rate, top skills, active players); supports self / specific player / server-wide views
    • /kila history [player] [page]: paginated conversation history
    • /kila memory [player]: view a player's profile (login stats + AI-analyzed 8-dimension profile)
    • /kila skills [page]: list currently available skills
  • Force-Execute a Skill: /kila run <skill> <prompt> skips intent recognition and directly executes the named skill; supports multi-step tasks and gracefully falls back to normal chat if the intent can't be parsed
  • Configuration Self-Diagnostic: /kila doctor runs 17 config checks (database / LLM connectivity / Spark / AI capability switches, etc.) to quickly locate misconfiguration; prints a redacted full-config dump to the console
  • Version & Update Check: /kila about shows current version, latest version, and download URL

🔧 Improvements

  • Retrieval Filter Refactor (hard threshold → soft/adaptive threshold): The old min_relevance_score (single hard threshold 30) is replaced by two-stage filtering
    • Noise floor: hard cutoff — anything below is dropped (default 25)
    • Relative threshold: soft cutoff — dropped if below top score × ratio (default 0.3)
    • Final threshold = max(noise floor, top score × relative threshold); mathematically guarantees at least 1 relevant result is returned — no more "relevant content exists but nothing comes back"
    • Tunable: lower both → more results (weakly related questions also answered); raise both → stricter (stay silent when unsure)
  • BM25 Parameter Tuning: chunk overlap 30 → 50 chars (longer-doc context more coherent after segmentation); min chunk 25 → 20 chars (fewer short-but-useful paragraphs wrongly dropped); short-doc protection — chunks under 50 chars are exempt from the length penalty (old command-style docs were severely under-scored for being too short)
  • Embedding Switches to Fusion Mode: No longer replaces BM25 with Embedding alone; instead BM25 + Embedding run in parallel and fuse via RRF (Reciprocal Rank Fusion) by rank. Chunks appearing in both paths rank higher, single-path chunks still participate — balancing exact keyword match and semantic understanding
  • Custom Dictionary Auto-Syncs with Corpus: Hot-reloading the knowledge base re-scans the corpus and rebuilds the tokenizer dictionary; new command names / identifiers take effect immediately
  • Project Stability: Fixed several NPE crashes from extreme inputs; hardened defenses against unknown user-authored docs
  • AI Error Categorized Hints (highlight of this release): When an AI call fails, players now see an actionable, cause-locating hint (e.g. "The model name may be incorrect. Please check the 'model' setting in llm.yml", "API Key is invalid or lacks permission"); the raw error detail is also logged to console WARN for quick troubleshooting. Covers all AI call scenarios: normal chat, skills, tasks, login greeting, AFK notifications, server broadcast
  • AI Timeout Friendly Hint: On response timeout, shows "AI response timed out. Please try again later" instead of exposing technical exception class names to the player
  • AFK Task Callback Degradation Hint: When an AFK task's callback config fails to parse, clearly states the task will run in "notify-only" mode (callback action cannot execute), with the raw content logged for troubleshooting
  • Code Standard Cleanup: Unified utility-class constructor style, removed fully-qualified class names, consolidated redundant method overloads (internal cleanup, no functional impact)
  • Complete English Support: All command output and prompts now fully support Chinese/English bilingual; the English-environment experience is complete
  • Permission-Aware Help Menu: /kila help shows only the commands the current player has permission to use
  • Granular Query Permissions: Viewing self / others / server-wide are authorized separately (kilacraft.query.self, kilacraft.usage.other, etc.)

🐛 Bug Fixes

  • Fixed NPE from missing null defenses in BM25Scorer.countOccurrences / EmbeddingCache.getVector / putVector / getNorm
  • Fixed players getting stuck on "Thinking..." with no error message when an AI call failed due to config errors (wrong model name / Key / URL, rate limiting, server-side failure, etc.)
  • Fixed AI error hints being mistakenly written into conversation history and polluting subsequent chat context (normal chat, login greeting, plugin-command paths)
  • Fixed profile analysis writing dirty data and bumping the version number when the AI returned an abnormal structure (added an 8-field whitelist + length cap)
  • Fixed occasional no-response hang when the AI secondary analysis failed during skill / task execution

⚠️ Compatibility

Upgrading from v2.1.1

  1. Stop server, replace JAR, start
  2. Recommended (for the full retrieval optimization): delete knowledge.yml and restart to let the plugin regenerate the latest version with the new config entries, then tweak as needed
  3. Works without deleting knowledge.yml: the old min_relevance_score is ignored (no longer used), and retrieval filtering auto-applies the default soft thresholds (noise_floor=25, relative_threshold=0.3)
  4. If you previously hand-maintained command names / identifiers in custom_dictionary.words, consider trimming them after upgrade — the new corpus-seeding dictionary auto-extracts these from knowledge-base content
  5. Recommended to delete the language config files (language.yml / language_en.yml): the help-menu format was restructured and many command messages were added this build; keeping the old file leaves new command prompts missing and the help menu outdated. Delete and restart to regenerate the latest version, then re-apply your custom text
  6. Server owners using English (en) mode should delete i18n/messages_en.yml: player-facing command text was migrated to the language.yml system this build, and the corresponding old keys were removed from messages_en.yml; deleting and restarting avoids leftover redundancy
2.1.1Релиз26.1.1, 26.1.2, 26.2 · 18 июня 2026 г.

v2.1.1 - Two-Phase Intent Recognition Architecture, Skill SPI Structured Response (needInfo Secondary Confirmation), Prompt System Restructuring, LLM Thinking Mode Governance

✨ New Features

  • Two-Phase Intent Recognition Architecture (Core of this release): Splits the original "single full skill list to LLM" into two phases, significantly reducing Token consumption
    • Phase 1 (Coarse Selection): Sends only one line of name + description per skill; LLM determines which skill categories are needed; pure small talk returns null directly, skipping Phase 2 for normal AI conversation
    • Phase 2 (Precise Selection): Sends full details (actions + hints) only for skills selected in Phase 1, completing action selection and parameter extraction; validates skill_name against whitelist, invalid names rejected
    • Quantified benefits:
      • Pre-refactor baseline (single-phase, per recognition): main rules ~26K + all skills full ~80K (incl. BukkitAPI 77 actions ~38K) ≈ 106K chars
      • Pure small talk: only Phase 1 (returns null, no Phase 2) ≈ 8K chars, ↓ ~92% vs baseline
      • Normal skill (1 built-in skill hit, median full size ~3.1K): Phase 1 + Phase 2 ≈ 38K chars, ↓ ~65%
      • Complex skill (hit incl. BukkitAPI 77 actions): Phase 1 + Phase 2 ≈ 73K chars, ↓ ~32%
      • Token conversion (Chinese-mixed content ~0.6 token/char): baseline ≈ 64K → three scenarios ≈ 4.8K / 22.6K / 43.5K
    • Response speed: two-phase adds one ultra-lightweight Phase 1 call, but each recognition no longer carries the full skill list; net latency depends on model and network
  • Skill SPI Structured Response Architecture (new needInfo secondary confirmation): Skill response semantics upgraded from "message-string prefixes" to typed status
    • New SkillResult.needInfo(message) factory: the official contract for third-party Skills to implement "needs info / secondary confirmation" (missing-param prompts, large-transfer confirmation, etc.); the framework emits a [NEED_INFO] marker and intent recognition drives the confirmation flow
    • SkillResult adds a typed SkillStatus enum (SUCCESS/FAILURE/NEED_INFO) + getStatus(); a new normalization layer SkillResultFormatter uniformly tags output to the LLM as [SUCCESS]/[FAILURE]/[NEED_INFO] — Skills write plain text, eliminating the inconsistency and double-tagging caused by hand-written prefixes
    • SPI Jar adds the SkillStatus class (6th class)
  • Intent Recognition Prompt System Restructuring (Chinese/English synced): Added "Three Inviolable Rules" top-priority rule (default to multi-step when uncertain); single-intent/multi-step decision refactored to three-condition check (required param provided by user + completable in one action + no dependency on other actions' return values); arithmetic placeholders unified for amount/quantity/price/threshold; parameter missing enforced "query-then-act" (null required params prohibited); Phase 1 coarse-selection positioning strengthened (favor recall over precision)
  • LLM Thinking Mode Governance: Normal conversation path auto-disables thinking for models with thinking on by default (MiMo, DeepSeek V4+, GLM 4.5+, Kimi K2+, Qwen3, Grok 4, Doubao thinking, MiniMax-M3, etc.); admin reasoning path injects enable params per model family; adapted OpenAI o-series / Doubao thinking max_completion_tokens. Resolves thinking tokens sharing max_tokens budget with output tokens causing empty output in MC scenarios (small quota)
  • Placeholder Arithmetic Evaluation Utility (ArithmeticUtil): Evaluation logic extracted to a public utility class; application scope expanded from multi-step task scalar params (amount/quantity/price) to CUSTOM task threshold, supporting relative thresholds like "5 below current health" ({step_0.health}-5). Single binary operation only (+ - * /), pure regex, no injection risk
  • JSON Auto-Repair Utility (JsonSafeGetUtil): Three-phase repair (filter excess closing → complete missing closing → remove trailing commas), abandons on cross-nesting, unified replacement of multiple duplicate implementations
  • Startup Version Update Detection: Async GitHub latest release check, colored console box notification on new version, silent on failure

🔧 Improvements

  • Diagnostic Model Fallback Mechanism: When admin.yml has no reasoning model configured, auto-falls back to llm.yml base chat model (reuses url/key/model only, max_tokens/timeout still use diagnostic-specific values to avoid report truncation), lowering the barrier for health monitoring
  • Health Monitoring Unavailable Layered Diagnostics: Checks prerequisites one by one (model / guardian switch / Spark installed), gives precise hints; diagnostic report header adds a "Diagnostic Model" row marking the actual generation model
  • DB History Load Count Tuning: loadFromDB limit changed from maxHistory×2 to maxHistory (default 20), reducing redundant loading
  • AFK Task String Condition Value Display Optimization: EvaluationResult adds actualValueStr; string conditions (e.g., block types) display real values instead of 0/1 placeholders
  • LLM Empty Response Friendly Hint: Returns "AI temporarily unavailable" to the player when streaming response is empty instead of an empty message (also logs SSE chunk count and recent raw data for troubleshooting)
  • JSON Scenarios Disable max_tokens: Intent recognition, profile analysis, etc. no longer set max_tokens, preventing complex JSON truncation; GenericBukkitAPI description enhanced to improve Phase 1 classification accuracy
  • Concurrency & Thread Safety: ConversationManager history queue upgraded to ConcurrentLinkedDeque + auto trim (MAX_HISTORY_SIZE=100); AFKTaskManager atomic registration prevents overflow; ProfileManager.flushAllProfiles single-connection batch update prevents cascade failure
  • Code Cleanup & Observability: LLMProvider interface simplified, ThinkingModelCapable upgraded to functional interface; SkillIntentRecognizer exception catching with full stack trace; GreetingPromptBuilder event summary merge eliminates ~140 lines of duplication; unified history access; cleaned up redundant i18n wrappers and translation dead keys
  • Configuration Hot-Reload Hardening: PersonalitiesConfigManager switched to snapshot replacement pattern, LLMConfigManager fields fully volatile
  • Embedding Retrieval Optimization: chunk vector norm precomputed and cached, cosine similarity computation reduced by 2/3
  • reconcileOnlineProfiles Single-Connection Batch: aligned with flushAllProfiles pattern
  • Profile Analysis Prompt Temporal Optimization (Chinese/English synced): No longer extracts volatile transient data like balance, coordinates, and inventory counts; retains only long-term stable traits to avoid stale wrong info lingering in the profile; existing profiles are auto-cleaned on the next analysis
  • Built-in Skills fully migrated to structured output: MarketActionSkill / CMISkill / MarketQuerySkill / CommandSkill stripped hand-written [FAILURE]/[NEED_INFO] prefixes (~80 sites), uniformly tagged by the framework normalization layer; TaskExecutor multi-step internal skip status switched to a typed enum, removing the old Chinese-prefix sniffing (fixes a latent classification mismatch under English locale)
  • Secondary confirmation & prompt governance (Chinese/English synced): intent recognition prompts add a "confirmation-flow" rule (reads the concrete value from history when the player confirms a prior action); llm.yml system prompt uniformly documents marker semantics; messages_en.yml strips marker prefixes embedded in keys/values and fixes a duplicate key; Skill-SPI-Integration-Guide.md (zh+en) fully rewritten

🐛 Bug Fixes

  • Fixed BM25Scorer.countOccurrences infinite loop on empty keyword causing mvn test to hang forever
  • Fixed KnowledgeRetriever.splitByFixedSize off-by-one where content exactly at MAX_CHUNK_SIZE was split into an extra trailing chunk by the overlap rollback logic
  • Fixed ConversationPersistenceService.mergeLoadedHistory clearing itself when loadedHistory and playerHistory are the same object via clear(), causing history loss (triggered when a player sends a message for the second time or later with valid in-memory history, via /ai command or chat listener path)
  • Fixed thinking/reasoning models producing empty output in normal conversation (covered by thinking mode governance)
  • Fixed profile analysis JSON parsing occasional failure (auto-repair then re-parse), CUSTOM task condition_plan null NPE, shutdown flushAllProfiles connection exception cascade failure, ConversationManager non-thread-safe ArrayDeque concurrent data loss
  • Security & Stability Hardening: Fixed multiple stability and security boundary issues; added recent active player cache to strengthen data isolation

⚠️ Compatibility

Upgrading from v2.1.0

  1. Stop server, replace JAR, start
  2. MUST remove intent_prompts.yml / intent_prompts_en.yml: the two-phase architecture + prompt system restructuring changed this file's structure significantly (new phase1 section, full rewrite into 9 sections, new "Three Inviolable Rules", etc.). Old file contents override the code's built-in new defaults, so the two-phase architecture and this prompt refactor will not take effectyou must delete and restart to let the plugin regenerate it
  3. Recommended (for full skill / model config optimization effects): the following config files are recommended to be deleted and regenerated (works without deletion, just missing some optimizations):
    • skills/afktask/AFKTaskSkill.yml / AFKTaskSkill_en.yml, skills/globalmarketplus/MarketActionSkill.yml / MarketActionSkill_en.yml, skills/bukkit/apis.yml / apis_en.yml
    • llm.yml (thinking mode governance notes + default model updates + skill-result marker semantics unified: added [SUCCESS]/[FAILURE]/[NEED_INFO]/[SKIPPED] four-marker fallback handling and multi-step failure semantics; old config overrides the new version) / admin.yml (diagnostic model fallback notes)
    • config.yml (new security.player_isolation.offline_cache section, recent active player cache)
    • database.yml (new h2.tcp section, H2 TCP Server access control; profile analysis prompt temporal optimization, old config overrides the built-in new version, update or delete to regenerate)
  4. Except for the intent_prompts.yml in step 2, all other config entries have code-level default fallbacks — works without deleting them
  5. Lower diagnostic feature barrier: when no admin.yml reasoning model is configured, health monitoring auto-falls back to llm.yml, usable without extra config (diagnostic quota still controlled by admin.yml, no conflict with normal conversation)
  6. Skill SPI fully backward compatible: SkillResult changes are purely additive (success/failure/public constructor signatures unchanged); already-compiled third-party Jars need no recompilation and no changes — at runtime the server's new SkillResult provides and auto-fills status (the SPI Jar is compile-time only, not packaged into third-party plugins). Old Skills need no changes; to use new capabilities like needInfo, recompile against the 2.1.1+ SPI Jar
2.0.2Релиз26.1.1, 26.1.2, 26.2 · 14 мая 2026 г.

v2.0.2 - Group Server Data Isolation, Skill Permission Pre-Filter, Incremental Profile Analysis, Profile Historical Snapshots, Placeholder Arithmetic, JSON Auto-Repair

✨ New Features

  • Incremental Profile Analysis: Profile analysis upgraded from "generate fresh each time" to "old profile + new conversations fusion update", long-term player traits are not overridden by short-term fluctuations
    • Prompts support Chinese/English bilingual configuration (first analysis / incremental analysis configured separately), supports hot-reload
  • Profile Historical Snapshots: New kca_profile_snapshot table, automatically saves a profile snapshot after each analysis, supports tracing any version's profile content and analysis time range, permanently retained
  • Group Server Data Isolation: Supports BungeeCord/Velocity cross-server data sharing and isolation
    • database.yml adds group.server_id config, requires deleting old config file to regenerate
    • Conversation history, server events, skill audit logs isolated by server_id; player profiles & social relations are inherently cross-server shared (no server_id field, not configurable)
    • Schema upgraded to v2, auto-creates server_id indexes (H2 / MySQL compatible)
    • Supports group config hot-reload
  • Skill Permission Pre-Filter: Dynamically filters available skills by player permissions during intent recognition; unauthorized skills excluded from LLM candidates
    • Skill interface adds getRequiredPermission(), all built-in Skills implement permission declaration
    • PluginPermissionEnum adds 8 Skill-level permission enums
  • Placeholder Arithmetic Expressions: Multi-step tasks support {step_x.field + 10} style arithmetic
  • LLM JSON Auto-Repair: Auto-completes missing closing braces in AFK task callback JSON

🐛 Bug Fixes

  • Fixed API_KEY unconfigured prompt pointing to wrong config file (config.ymlllm.yml)
  • Fixed getBoolean() silently returning default for "shared"/"isolated" string values (Critical)
  • Fixed DatabaseManager.reload() not updating currentConfig on hot-reload
  • Fixed enchanted golden apple event name exceeding length limit
  • Fixed SQL syntax incompatibility in expired conversation/event/audit log cleanup using derived table syntax
  • Fixed ProfileManager not rebuilding DAO on hot-reload, causing table_prefix changes to not take effect
  • Fixed update() overwriting profile analysis fields with cached stale values: profile_data / profile_analyzed_at now exclusively written by updateProfileData(), runtime state updates no longer overwrite AI analysis results
  • Fixed /ai clear not preventing DB history reload on next conversation: introduced one-time cleared marker to skip DB loading in loadHistoryIfNeeded
  • Fixed AI greeting writing to memory history causing loadHistoryIfNeeded to skip DB load: empty check now excludes assistant-only history
  • Fixed AI request errors being silently swallowed without console output
  • Unified AI call timeout settings, fixed profile analysis timeout inconsistency with other AI calls

🔧 Improvements

  • Distributed scheduled task race safety: watermark markers + SELECT FOR UPDATE row locks for distributed mutual exclusion
  • database.yml group config section moved up + unified comment style
  • Removed DataCleanupService.serverId dead code
  • Improved key field length documentation comments
  • Removed unused parameter from social relation interaction type enum
  • ConditionPlan operator descriptions migrated to I18nService.tr() system
  • Profile injection extended to all player-facing LLM output paths (secondary analysis, stage notifications, broadcast) with unified ProfileManager.injectProfileSummary() API
  • Player profile dimensions expanded from 5 to 8 (added interests/boundaries/communication/spatial/facts), profile injection wording changed to "reference context" to avoid interfering with AI conversation judgment, incremental analysis auto-migrates legacy fields
  • Incremental profile analysis now filters out version/analyzed_at metadata fields when injecting old profile, preventing LLM misinterpretation
  • SPI integration guide, database config guide, and player profile & social relations system guide updated in both Chinese and English (corrected table field descriptions to match actual DDL, added incremental analysis workflow and snapshot mechanism)
  • Intent recognition prompt global optimization: strengthened skill semantic matching standard, clarified "data retrieved could help answer" ≠ "skill matches user intent", constrained question decomposition to user's explicitly stated information needs
  • BukkitStatsSkill prompt narrowed: limited to Minecraft vanilla statistics only, prohibited guessing or fabricating enum names
  • CommandSkill prompt optimization: clarified matching boundary between "executable action" and "information query", removed examples unsuitable for survival players
  • LLM secondary analysis prompt enhanced with boundary constraints, reducing hallucination and unreasonable inference
  • Third-party Skill registration adds compatibility pre-check mechanism, registration failure does not affect main process

⚠️ Compatibility

Upgrading from v2.0.1

  1. Stop server, replace JAR, start — defaults to standalone mode, no config changes needed
  2. Database Schema auto-upgrades to v2 (adds profile_snapshot table + 3 server_id indexes), no manual migration needed
  3. All new config entries have code-level default values — the plugin works correctly even without deleting any config files
  4. Recommended (to get the full v2.0.2 prompt optimization effects): delete the following config files and restart the server to let the plugin regenerate the latest versions:
    • intent_prompts.yml / intent_prompts_en.yml (intent recognition prompts strengthened with semantic matching standards)
    • skills/bukkit/BukkitStatsSkill.yml / BukkitStatsSkill_en.yml (narrowed stats query matching scope)
    • skills/command/CommandSkill.yml / CommandSkill_en.yml (optimized command matching boundary)
    • llm.yml (strengthened prohibition on exposing statistics, old version has similar rules but weaker wording, optional)
    • database.yml (new group server config section + incremental profile prompts + profile dimensions upgraded to 8 + profile timeout adjustment, can manually add or delete to regenerate)
  5. For group server mode, add group.server_id config to database.yml (leave empty for single-server)
  6. v2.0.2 adds profile.incremental_system_prompt / incremental_system_prompt_en config entries (incremental analysis prompt when existing profile is present), leave empty to use built-in defaults

Upgrading from v2.0.0

  1. Follow the "Upgrading from v2.0.1" steps above first
  2. v2.0.1 added configurable profile analysis prompts (profile.analysis_system_prompt etc. in database.yml), delete database.yml to regenerate if you want to customize prompts
  3. If using English mode (language: en), a greeting_en.yml English greeting config file will be auto-generated on first startup

Upgrading from versions before v2.0.0

  1. You must read the v2.0.0 compatibility section first — that version introduced database persistence, config architecture refactoring, and other major changes
  2. Upgrade steps:
    • Stop server and backup the entire plugins/Kilacraft-AI/ directory
    • Replace Kilacraft-AI.jar with the new version
    • On first startup, the plugin will auto-create new config files and database tables (Schema auto-upgrades to v2); old config files will not be deleted
    • Follow log prompts to manually migrate custom settings from the old config.yml to new config files (llm:llm.yml, agent:llm.yml, output:output.yml, knowledge:knowledge.yml)
    • If using MySQL, create the database in advance and configure database.yml
    • Strongly recommended to delete intent_prompts.yml / intent_prompts_en.yml and Skill config files under skills/ directory to let the plugin regenerate the latest versions
  3. Conversation history in versions <2.0.0 was stored in memory only — there is no historical data to migrate, data accumulation starts fresh after upgrade

New Permission Nodes

  • kilacraft.afk.task / kilacraft.bukkit_fx / kilacraft.bukkit_stats / kilacraft.bukkit_api (default true)
  • kilacraft.cmi / kilacraft.command.execute / kilacraft.market.action (default OP)
  • kilacraft.market.query / kilacraft.utility (default true)

Version Recommendation

Versions prior to v2.0.2 (including all v1.x releases) are no longer available for direct download. All users are recommended to upgrade to v2.0.2 for better system stability, security, and lower token consumption.

Комментарии

Загружаем…