Skip to content

Astroworld-MC/AstroChatBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AstroChatBot

A keyword-matching chat bot for Minecraft servers that automatically replies to player questions with configurable responses. Supports multiple languages, per-category cooldowns, and intent detection to avoid false triggers.

Built by Astroworld | Need hosting? Try Astroworld Hosting

Features

  • Fully config-driven: add, remove, or edit categories without touching code
  • Multi-language support with automatic language detection
  • Intent detection: only responds to questions and help requests, not casual mentions
  • Per-category cooldowns to prevent spam
  • Unicode normalization for accent-insensitive matching
  • Multi-word keyword phrase matching
  • Hot-reload with /chatbot reload
  • OPs are ignored (staff chat won't trigger the bot)

Requirements

  • Paper 1.20+
  • Java 17+

Installation

  1. Drop AstroChatBot-1.0.0.jar into your plugins/ folder.
  2. Restart the server. A default config.yml will be generated with example categories.
  3. Edit plugins/AstroChatBot/config.yml to customize responses for your server.
  4. Run /chatbot reload or restart the server.

Commands

Command Description Permission
/chatbot reload Reload the configuration file astrochatbot.admin

Permissions

Permission Description Default
astrochatbot.admin Allows reloading the plugin config op

Configuration

General Settings

prefix: "&8[&b&lChat&f&lBot&8] &7"
cooldown-seconds: 8

Intent Detection

The bot uses two mechanisms to detect whether a message is a question:

  1. Question starters -- words at the start of a message (e.g. "how", "what", "where")
  2. Helper patterns -- phrases anywhere in the message (e.g. "i need", "help me")

A message containing ? is always treated as a question.

Adding a Category

categories:
  MY_CATEGORY:
    intent-required: true
    keywords:
      - "my keyword"
      - "another phrase"
    answers:
      en: "English response here"
      nl: "Dutch response here"
      es: "Spanish response here"
  • intent-required: true means the message must look like a question
  • intent-required: false means any message containing the keywords will trigger
  • Keywords support multi-word phrases (matched as token sequences)
  • The en answer is the fallback when a language has no specific answer

Language Detection

Add language markers to help the bot detect which language the player is writing in:

languages:
  nl:
    markers:
      - "hoe"
      - "wat"
      - "waar"

The bot counts marker matches and picks the language with the highest score. English is the default.

How It Works

  1. A player sends a chat message (OPs are ignored).
  2. The message is normalized: lowercased, accents stripped, split into tokens.
  3. Messages shorter than 4 tokens are ignored to avoid false positives.
  4. Intent detection checks if the message looks like a question.
  5. Categories are checked in order; the first matching category wins.
  6. The bot detects the language and picks the matching answer.
  7. If the category is not on cooldown, the response is broadcast to all players.

License

MIT License - see LICENSE for details.