- Resource Type
- Originality
- API Version
- 1.0.1
- Copyright Link
- #
ElySecurity Server Security Plugin
A powerful Minecraft Nukkit server security plugin providing comprehensive player management and content security features.
🚀 Features
🔒 Core Security Functions
- OP Permission Management - Dual storage mode: Database/File
- Permission Status Synchronization - Real-time detection and synchronization of player permissions
- Content Security Detection - Supports dual detection via local and Baidu API
🛡️ Anti-Violation Mechanisms
- Smart Spam Detection - Multi-dimensional detection based on message interval, similarity, and information entropy
- Prohibited Word Filtering - Local word library + Baidu AI Content Moderation
- Multiple Punishment Methods - Configurable punishments: warning, kick, mute, etc.
⚙️ Technical Features
- Dual Storage Mode - Choice between MySQL database or YAML file storage
- Redis Cache Support - High-performance caching for acceleration
- Multi-language Support - Chinese/English interface
- Asynchronous Detection - Does not block the server's main thread
📦 Installation Requirements
Environment Requirements
- Nukkit API: 1.0.10+
- Java: 8+
- Optional: MySQL 5.7+ / Redis 5+
Dependencies
- Required: Nukkit Server
- Optional: MySQL Driver, Redis Client
⚡ Quick Start
1. Install the Plugin
Place ElySecurity.jar into the plugins/ directory and restart the server.
2. Basic Configuration
Edit plugins/ElySecurity/config.yml:
# Basic Settings
language: "zh_CN" # Language: zh_CN / en_US
# Storage Mode Selection
mysql:
enabled: false # Disable MySQL, use file storage
3. Add an Administrator
Execute in the console:
op add YourGameID
🛠️ Configuration Guide
Storage Mode Configuration
Option A: Use File Storage (Simple)
mysql:
enabled: false
OP list will be saved at: plugins/ElySecurity/admin.yml
Option B: Use Database Storage (Recommended)
mysql:
enabled: true
host: "localhost"
port: 3306
database: "elysecurity"
username: "root"
password: "your_password"
Security Feature Configuration
Anti-Spam Settings
anti-spam:
enabled: true
message-interval: 1000 # Message interval(ms)
similarity-threshold: 0.8 # Similarity threshold
punishment: "kick" # Punishment method: warning/kick
Prohibited Words Settings
prohibited-words:
enabled: true
mode: "local" # local/baidu/both
punishment: "mute" # Punishment method: warning/kick/mute
mute-duration: 300 # Mute duration(seconds)
📋 Command List
| Command | Permission | Description | Example |
|---|---|---|---|
/op add <player> |
elysecurity.op | Add OP permission | /op add Steve |
/op remove <player> |
elysecurity.op | Remove OP permission | /op remove Alex |
⚠️ Note: OP commands can only be executed from the server console.
📁 File Structure
plugins/ElySecurity/
├── config.yml # Main configuration file
├── admin.yml # OP list (File mode)
├── prohibited-words.yml # Prohibited word library
├── lang/
│ ├── zh_CN.yml # Chinese language file
│ └── en_US.yml # English language file
└── logs/ # Log directory
🔧 Advanced Features
Redis Cache Acceleration
redis:
enabled: true
host: "localhost"
port: 6379
password: ""
Baidu AI Content Moderation
baidu-api:
enabled: true
api-key: "your_api_key"
secret-key: "your_secret_key"
Custom Prohibited Words
Edit prohibited-words.yml:
local-words:
- "Banned Word 1"
- "Banned Word 2"
- "Banned Word 3"
❓ FAQ
Q1: Plugin fails to load?
- Check if Nukkit version ≥ 1.0.10
- Check if Java version ≥ 8
- Check server logs for detailed error messages
Q2: OP permissions not syncing?
- Ensure storage mode configuration is correct
- Check database connection (if using MySQL)
- Try re-executing the OP command
Q3: How to backup OP list?
- File mode: Backup
admin.yml - Database mode: Backup the
opstable in MySQL
Q4: How to update the plugin?
- Backup configuration files
- Replace the plugin JAR file
- Restart the server
- Check configuration compatibility
📊 Performance Optimization Suggestions
- Small-scale servers: Use file storage mode
- Medium/Large servers: Use MySQL+Redis combination
- Adjust detection thresholds: Tune sensitivity based on server load
- Regular cache cleanup: Restart to free memory after long uptime
🤝 Contribution & Support
Issue Reporting
When reporting issues, please provide:
- Nukkit version
- Plugin version
- Error log screenshot
- Steps to reproduce
Feature Suggestions
Feature suggestions are welcome via GitHub Issues.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
🔌 API Calls
Baidu Content Moderation API
Other plugins can call this plugin's Baidu content moderation function via:
// Get the ElySecurity plugin instance
PluginBase elySecurity = getServer().getPluginManager().getPlugin("ElySecurity");
// Check if content violates rules
if (elySecurity instanceof cn.ElysianArena.ElySecurity.Main) {
cn.ElysianArena.ElySecurity.Main main = (cn.ElysianArena.ElySecurity.Main) elySecurity;
cn.ElysianArena.ElySecurity.security.ViolationResult result = main.getProhibitedWords().checkContent(playerName, content);
if (result.isViolated()) {
// Handle violating content
String source = result.getSource(); // Violation source (local/baidu)
List<String> details = result.getViolationDetails(); // Violation details
double confidence = result.getConfidence(); // Confidence level
}
}
The returned ViolationResult object contains the following fields:
violated: Whether it violates rulesviolationType: Violation type IDsubType: SubtypeviolationDetails: Violation details (e.g., matched keywords)source: Detection source (local/baidu)confidence: Confidence levelmessage: Additional message
✨ Changelog
v1.0.0
- ✅ OP Permission Management
- ✅ Anti-Spam System
- ✅ Prohibited Word Filtering
- ✅ Dual Storage Mode Support
- ✅ Multi-language Interface