Anti-Politically-Related-Content
A Minecraft Bukkit plugin that uses AI-powered real-time moderation to automatically detect and filter politically sensitive content in chat, commands, and player names.
Quick challenge
How far can you run before the mobs catch you?
Minecraft check
Confirm your run
Complete the quick check to get your code.
Anti-Politically-Related-Content
Anti-Politically-Related-Content Plugin
Project Overview
This is a Minecraft Bukkit plugin designed to detect and filter politically related content within the game. The plugin utilizes the OpenRouter AI API to perform real-time moderation of player chat content, commands, and player IDs.
Features
- Real-time monitoring of player chat content - Detection of political content in player commands - Checking player IDs upon new player joins - Automatic handling of violations: - Players sending political content are kicked - Players using inappropriate IDs are banned - Asynchronous API calls to avoid impacting server performance - 【Version 2.0 Update】Admins can enable/disable the plugin via command - 【Version 4.0-RELEASE Update】Test API address connection via `/aprc test` - 【Version 4.0-RELEASE Update】API-related configurations can be changed via the config file (meaning the author can upload a pre-packaged jar) - 【Version 4.0-RELEASE Update】`/aprc reload` can reload the configuration file - 【Version 4.0-RELEASE Update】Added a backup API address slot to prevent sudden downtime of one API platform
Installation Requirements
- Minecraft Paper Server 1.21.4+ - Java 17 or higher - A valid OpenRouter API key (visit openrouter.ai to create one) - (Optional) A valid SiliconFlow API key (visit SiliconFlow Official Website to create one) - (Optional) API keys from other open API platforms (requires some programming knowledge to change the model name and API address)
Installation Guide
1. Build the project using Maven: ```bash mvn clean package ```
1. Copy the generated target/anti-politically-related-content-1.0-SNAPSHOT.jar to the server's plugins folder 2. Restart the server
Configuration
API Settings (Modify the config file generated after server startup)
```yaml primary: api_key: Primary_API_Key model: deepseek/deepseek-chat-v3-0324:free api_url: https://openrouter.ai/api/v1/chat/completions backup: api_key: Backup_API_Key model: deepseek-ai/DeepSeek-R1-0528-Qwen3-8B api_url: https://api.siliconflow.cn/v1/chat/completions ```
Response Customization
Modify the following methods in Main.java to change violation handling:
- handleChatViolation() - Handles chat violations - handleNameViolation() - Handles name violations
Usage Example
1. Install and configure the plugin 2. The plugin will automatically: - Scan all chat messages - Check new player names - Take automatic action upon detecting violations 3. Players with the aprc.admin permission can use the /aprc <test|on|off|reload> command to test the API address/enable the plugin/disable the plugin/reload the plugin.
Notes
1. An internet connection is required to access the API 2. API calls may have a 1-3 second delay 3. The free version has rate limits (upgrading is recommended for high-traffic servers) 4. Please test thoroughly before deploying on a production server (the author is also unsure about the number of potential bugs)
Developer Information
- Project Name: Anti-Politically-Related-Content - Version: 4.0-RELEASE - Dependencies: - PaperAPI - OkHttp 4.12.0 - Gson 2.10.1
License
MIT License