Skip to content

AllFiRE0/CoreProtectionAssistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

244 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

CoreProtectionAssistant

Build Status Version License Java

Advanced staff monitoring and player protection system for Minecraft servers.


๐Ÿ“– Overview

CoreProtectionAssistant (CPA) is a zero-trust staff monitoring and player reputation system. It tracks staff actions, analyzes player behavior, and provides detailed statistics without creating new menus โ€” all data is accessible via PlaceholderAPI for use in other plugins (CMI, DeluxeMenus, ItemsAdder, etc.).

Key principle: The plugin doesn't store data that already exists elsewhere โ€” it reads from CoreProtect, CMI, and LuckPerms.


๐Ÿ‘ค Author

AllF1RE


โœจ Features

Staff Monitoring

  • Track all staff commands (/give, /gamemode, /ban, /mute, /kick, /invsee, etc.)
  • Abuse Score System โ€” calculates a 0-100 score based on suspicious actions
  • Automatic warnings when abuse score exceeds thresholds
  • Detailed staff statistics with full action history

Player Protection

  • Unified Chat Rules โ€” single configuration for both punishments and apologies
  • Regex-based detection with priorities and recidivism tracking
  • Automatic warning clearance for apologies
  • Apologies Tracking โ€” counts apologies and calculates repentance ratio (apologies / violations)
  • Report System with anti-abuse protection
  • Automatic violator analysis based on playtime, warnings, and report count
  • Same IP & Alt Detection โ€” detects players with same IP and similar nicknames
  • Prohibited Permissions Check โ€” alerts when staff members have dangerous permissions

๐Ÿ›ก๏ธ Grief Detection (NEW)

  • Direct CoreProtect database reading โ€” no duplicate storage
  • Block history analysis โ€” checks if other players interacted with the same block
  • Similar nickname detection โ€” 1=i=l, 0=o, 5=s=6, etc.
  • Configurable tracked blocks โ€” chests, furnaces, shulkers, hoppers, etc.
  • Separate punishments for players and staff

๐Ÿค– ChatBot (NEW)

  • Fully configurable chatbot that responds to player messages
  • Rule-based system with priorities, permissions, and cooldowns
  • Condition support โ€” use PAPI placeholders with comparisons (>, <, ==, contains, AND, OR)
  • Symbol prefix โ€” respond only to messages starting with !, ?, etc.
  • Random responses โ€” choose from a list of possible answers
  • Delayed responses โ€” bot can wait before replying
  • Chance-based triggers โ€” probability of response in percentage
  • Context variables โ€” %player_name%, %player_world%, %player_time%, %target%, %message%
  • All command prefixes supported: message!, broadcast!, asConsole!, sound!, title!, actionbar!

โฑ๏ธ Temporary Warnings & Silent Mode (NEW)

  • Temporary warnings โ€” -t:1d (day), -t:1h (hour), -t:1m (minute), -t:1s (second)
  • Silent mode โ€” -s flag suppresses all command output
  • Example: /cpa warn Player Griefing -t:20m -s

Statistics & Integration

  • CoreProtect integration (via reflection and direct DB โ€” no hard dependency)
  • PlaceholderAPI support (35+ placeholders)
  • SQLite (with HikariCP connection pool) and MySQL support
  • Optional integrations: CMI, LuckPerms

Quality of Life

  • Full localization โ€” all messages in lang.yml (supports HEX colors &#RRGGBB)
  • Message toggling โ€” disable any message by setting it to "" or "none"
  • Offline player tab-complete โ€” all commands suggest offline players (up to 20)
  • Centralized reload โ€” /cpa reload reloads all configurations including ChatBot
  • Debug mode โ€” debug: true/false in config for troubleshooting

๐Ÿ“‹ Requirements

Requirement Version Required
Paper / Leaf 1.20.4+ โœ… Required
Java 21+ โœ… Required
CoreProtect 22.4+ โญ Recommended
PlaceholderAPI 2.11+ โญ Recommended
CMI 9.7+ โญ• Optional
LuckPerms 5.4+ โญ• Optional

๐Ÿ“ฅ Installation

  1. Download the latest CoreProtectionAssistant-1.1.0.jar from Releases
  2. Place it in your server's plugins/ folder
  3. Install recommended plugins (CoreProtect, PlaceholderAPI)
  4. Restart your server
  5. Configure plugins/CoreProtectionAssistant/config.yml
  6. Use /cpa reload to apply changes

โš™๏ธ Configuration Files

File Description
config.yml Main configuration (database, tracked commands, abuse weights, grief detection)
lang.yml All plugin messages (fully customizable, supports HEX colors)
chattrules.yml Chat filter rules (punishments + apologies)
reports.yml Report categories and anti-abuse settings
chatbot.yml ChatBot rules and responses (NEW)

Auto Cleanup (config.yml section)

cleanup:
  player_commands: 30   # Days to keep player commands
  staff_actions: 90     # Days to keep staff actions
  chat_violations: 30   # Days to keep chat violations
  apologies: 30         # Days to keep apologies
  grief_actions: 30     # Days to keep grief actions

Grief Detection (config.yml section)

grief_detection:
  enabled: true
  allowed_regions:
    - "__global__"
    - "otherRegion"
  tracked_blocks:
    - "CHEST"
    - "FURNACE"
    - "BARREL"
  grief_commands:
    - "asConsole! cpa warn %player_name% Griefing detected -t:20m -s"
  staff_grief_commands:
    - "asConsole! cpa warn %player_name% Staff griefing -t:1h"
  abuse_weight: 10
  min_time_between_actions: 5

๐ŸŽฎ Commands

Command Permission Description
/cpa - Show help menu
/cpa stats <player> cpa.moder View player statistics
/cpa resetstats <player> <type> cpa.staff Reset player statistics (commands/all/ban/mute/kick/give/gm/rating/warn/free)
/cpa staff <player> cpa.staff View staff member statistics
/cpa top <type> [page] cpa.moder View leaderboards
/cpa check <player> cpa.moder Quick player check
/cpa warn <player> [reason] [-t:1d|1h|1m|1s] [-s] cpa.warn Issue warning (temporary or permanent, silent mode)
/cpa warn clear <player> <amount> [-s] cpa.warn.clear Clear warnings (silent mode supported)
/cpa warn list <player> [-s] cpa.moder List active warnings (silent mode supported)
/cpa reload cpa.reload Reload configuration
/cpa report <player> <reason> cpa.report Report a player (staff)
/report <player> <reason> cpa.report Report a player

Aliases: /cpa, /protect, /adminprotect, /aa


๐Ÿ” Permissions

Permission Default Description
cpa.moder op Access to player statistics
cpa.staff op Access to staff statistics (owner only!)
cpa.resetstats op Can reset player statistics
cpa.warn op Can issue warnings
cpa.warn.clear op Can clear warnings
cpa.report true Can use /report
cpa.report.see op Can see report notifications
cpa.report.tp op Can teleport to report location
cpa.reload op Can reload configuration
cpa.bypass.chat op Bypass chat filter
cpa.chatbot.use true Can interact with ChatBot (NEW)
cpa.chatbot.bypass op Ignored by ChatBot (NEW)

๐Ÿ“Š Placeholders (PlaceholderAPI)

Player Statistics

Placeholder Description
%cpa_player_blocks_broken% Total blocks broken
%cpa_player_blocks_placed% Total blocks placed
%cpa_player_chests_opened% Total containers opened
%cpa_player_commands_count% Total commands used (from internal DB)
%cpa_player_deaths% Total deaths
%cpa_player_kills% Total kills
%cpa_player_first_seen% First join date
%cpa_player_last_seen% Last seen date
%cpa_player_warnings_count% Active warnings
%cpa_player_violations_count% Chat violations
%cpa_player_apologies_count% Total apologies
%cpa_player_violations_apologies_ratio% Repentance ratio (apologies / violations)
%cpa_player_time_since_last_violation% Seconds since last violation
%cpa_player_cmd_<command>% Usage count of specific command (e.g., %cpa_player_cmd_tpa%)
%cpa_player_reports_against% Total reports received
%cpa_player_reports_filed% Total reports sent
%cpa_player_reports_<category>% Reports received by category (e.g., %cpa_player_reports_griefing%)
%cpa_reports_count_<category>_<player>% Reports by category for specific player (e.g., %cpa_reports_count_griefing_AllF1RE%)

Staff Statistics

Placeholder Description
%cpa_staff_bans_count% Total bans issued
%cpa_staff_mutes_count% Total mutes issued
%cpa_staff_kicks_count% Total kicks issued
%cpa_staff_gives_count% Total /give uses
%cpa_staff_abuse_score% Current abuse score (0-100)
%cpa_staff_warnings_count% Warnings received

๐Ÿ—„๏ธ Database

Supports both SQLite (default) and MySQL.

Tables Created

  • cpa_command_logs โ€” All tracked commands
  • cpa_staff_actions โ€” Staff activity log
  • cpa_warnings โ€” Player and staff warnings
  • cpa_reports โ€” Player reports
  • cpa_chat_violations โ€” Chat filter violations
  • cpa_apologies โ€” Apology history
  • cpa_abuse_scores โ€” Staff abuse scores
  • cpa_grief_actions โ€” Grief detection log
  • cpa_player_commands โ€” All tracked player and staff commands
  • cpa_player_commands โ€” All tracked player and staff commands

Acknowledgements

  • PaperMC โ€” Server software
  • CoreProtect โ€” Block logging
  • PlaceholderAPI โ€” Placeholder support
  • CMI โ€” Economy & playtime
  • LuckPerms โ€” Permission management
  • WorldGuard โ€” Region protection

๐Ÿ”จ Building from Source

Requirements

  • JDK 21
  • Maven 3.9+

Build Commands


โ“ FAQ

Q: Why "zero-trust"?
A: The plugin assumes staff members might abuse their powers. It tracks everything and calculates an abuse score to alert owners.

Q: Does it work without CoreProtect?
A: Yes, but block/chest/command statistics and grief detection will be unavailable.

Q: Can I customize the abuse score weights?
A: Yes, in config.yml under abuse_weights.

Q: How do I add new chat rules?
A: Edit chattrules.yml and use /cpa reload.

Q: What is "recidivism"?
A: Repeated violations within a time window result in harsher punishments.

Q: How do I disable a specific message?
A: Set it to "" or "none" in lang.yml.

Q: How do I reset a player's statistics?
A: Use /cpa resetstats <player> <type> (commands, all, ban, mute, kick, give, gm, rating, warn, free).

About

A Minecraft plugin :)

Resources

License

Stars

Watchers

Forks

Contributors

Languages