# UNSTABLE SMP — Advanced Punishment Plugin
## Project Overview
Create a fully functional, production-ready Minecraft Paper plugin named **UnstablePunish** for the Minecraft server **Unstable SMP**.
The plugin must include a complete punishment management system with bans, mutes, kicks, warnings, advanced staff activity logs, Discord webhook integration, unique punishment IDs, and an automated chat moderation system.
**Technical requirements:**
- Language: Java 21 or the version required by the target Paper build.
- Server software: Paper, targeting our Paper 26.2 build. Verify API compatibility.
- Build system: Maven.
- Database: No MySQL, MongoDB, or external database.
- Storage: YAML configuration and data files.
- Formatting: MiniMessage, including HEX gradients.
- Permissions: LuckPerms-compatible Bukkit permissions.
- Discord logging: Configurable webhooks.
- All features must be configurable.
- No paid APIs or mandatory external services.
- No pseudocode, placeholder implementations, or unfinished features.
---
# 1. Punishment Commands
Implement these commands:
| Command | Description |
|---|---|
| `/punish ` | Opens punishment GUI |
| `/ban [reason]` | Ban a player |
| `/tempban [reason]` | Temporary ban |
| `/unban ` | Remove a ban |
| `/mute [reason]` | Mute a player |
| `/tempmute [reason]` | Temporary mute |
| `/unmute ` | Remove a mute |
| `/kick [reason]` | Kick a player |
| `/warn [reason]` | Warn a player |
| `/history ` | View punishment history |
| `/banlookup ` | Search by punishment ID |
| `/punishlogs [player]` | View staff activity |
| `/punishadmin reload` | Reload configurations |
| `/punishadmin reasons` | Manage reasons |
| `/chatfilter` | Manage automatic chat moderation |
Support online and offline players for applicable commands.
Use UUIDs for player identification, not just usernames.
# 2. Custom Punishment GUI
When a staff member executes `/punish `, open a professional inventory GUI.
Main categories:
- 🔨 Bans
- 🔇 Mutes
- 👢 Kicks
- ⚠️ Warnings
- 📋 Punishment History
**CRITICAL: Every category must have its OWN reasons.**
When clicking Bans, show ONLY ban reasons.
When clicking Mutes, show ONLY mute reasons.
When clicking Kicks, show ONLY kick reasons.
When clicking Warnings, show ONLY warning reasons.
Never combine all reasons into one menu.
Each reason must have:
- Custom display name
- Configurable material/icon
- Description/lore
- Duration
- Required permission
- Optional confirmation screen
- Optional escalation rules
Include Back, Next Page, Previous Page, and Cancel buttons.
# 3. Default Ban Reasons
| Reason | First Offense | Second Offense | Third Offense |
|---|---|---|---|
| Cheating / Hacked Client | 30 days | 90 days | Permanent |
| X-Ray / Exploiting | 14 days | 30 days | Permanent |
| Duplication Exploit | 30 days | 90 days | Permanent |
| Bug Abuse | 7 days | 30 days | Permanent |
| IRL Trading | Permanent | Permanent | Permanent |
| Account Compromise / Security | Until review | Until review | Until review |
| Ban Evasion | 30 days | 90 days | Permanent |
| Severe Harassment | 7 days | 30 days | Permanent |
| Threats / Doxxing | Permanent | Permanent | Permanent |
| Advertising Other Servers | 7 days | 30 days | Permanent |
| Inappropriate Builds | 3 days | 7 days | 30 days |
| Repeated Rule Violations | 7 days | 30 days | Permanent |
| Management Placed Ban | Another Millennium | Another Millennium | Another Millennium |
**Management Placed Ban:**
- Only available to management with a special permission.
- Cannot be removed using normal `/unban`.
- Must be removed using `/punishadmin managementunban `.
- Every management unban must be logged.
- Requires a separate permission.
- Display duration as `Another Millennium`.
- Internally use a permanent ban, not a real 1,000-year timer.
- Mark the punishment as management-locked.
IRL Trading bans should also be management-locked by default, with configurable removal permissions.
# 4. Default Mute Reasons
| Reason | First Offense | Second Offense | Third Offense |
|---|---|---|---|
| Spam | 15 minutes | 1 hour | 1 day |
| Flooding Chat | 10 minutes | 30 minutes | 12 hours |
| Excessive Caps | Warning | 15 minutes | 1 hour |
| Toxic Behavior | 1 hour | 12 hours | 3 days |
| Harassment | 12 hours | 3 days | 7 days |
| Discrimination / Hate Speech | 7 days | 30 days | Permanent |
| Advertising | 1 day | 7 days | 30 days |
| Inappropriate Language | 30 minutes | 3 hours | 1 day |
| Bypassing Chat Filter | 1 hour | 12 hours | 3 days |
| Staff Disrespect / Abuse | 1 hour | 12 hours | 3 days |
| Repeated Chat Violations | 1 day | 7 days | Permanent |
All mute reasons and durations must be editable.
# 5. Default Kick Reasons
Kicks must have their own category and NEVER show ban or mute reasons.
Default kick reasons:
- Disruptive Behavior
- Inappropriate Skin
- Inappropriate Username
- Chat Disruption
- Refusing Staff Instructions
- AFK Abuse
- Suspicious Activity
- Exploit Investigation
- Server Interference
- General Rule Violation
- Management Requested Kick
Kicks do not have durations.
Allow staff to add custom explanations.
# 6. Unique Punishment IDs
Every punishment must receive its own unique ID.
Examples:
`#84jd48`
`#9ka73m`
`#7mx21q`
Requirements:
- Generate a random six-character alphanumeric ID.
- Prefix it with `#`.
- Never reuse an existing ID.
- Case-insensitive lookup.
- Store IDs permanently.
- Apply IDs to bans, mutes, kicks, and warnings.
- Display the ID in punishment screens, history, and Discord logs.
The `/banlookup` command must accept IDs with or without `#`.
# 7. Custom Ban Screen
Create a fully configurable Minecraft disconnect screen using MiniMessage.
Default design:
**UNSTABLE SMP**
You have been banned from this server.
**Reason:** Cheating / Hacked Client
**Duration:** 30 Days
**Punishment ID:** #84jd48
**Banned By:** StaffName
**Expires:** 30 November 2026
Think this punishment was unfair?
**Appeal:** discord.gg/nUSVsMeHYZ
Use a bold pink/purple gradient for the title:
- #FF4FD8
- #B84DFF
- #FF65D4
All other text should be clean, professional, and readable.
The ban screen must support:
- Permanent bans
- Temporary bans
- Management-locked bans
- Dynamic expiration dates
- Dynamic staff names
- Dynamic punishment IDs
- Custom reasons
- Configurable appeal links
Also create custom mute notifications and kick disconnect screens.
# 8. Advanced Discord Webhook Logging
Create a complete Discord webhook logging system.
Every category must support a separate webhook URL.
Configuration example:
```yaml
webhooks:
enabled: true
bans:
enabled: true
url: ""
unbans:
enabled: true
url: ""
mutes:
enabled: true
url: ""
unmutes:
enabled: true
url: ""
kicks:
enabled: true
url: ""
warnings:
enabled: true
url: ""
staff-commands:
enabled: true
url: ""
chat-filter:
enabled: true
url: ""
management-actions:
enabled: true
url: ""
config-changes:
enabled: true
url: ""
```
Every webhook embed must show:
- Action type
- Target username
- Target UUID
- Staff member
- Staff UUID, if applicable
- Reason
- Duration
- Punishment ID
- Offense number
- Date and time
- Expiration date
- Server name
- Action source: GUI, command, console, or automated moderation
Use Discord embed colors matching the action.
**Advanced staff command logging:**
Log every execution attempt of a command belonging to this plugin, including failed commands.
Examples:
- `/ban`
- `/mute`
- `/kick`
- `/unban`
- `/unmute`
- `/punish`
- `/punishadmin`
- `/chatfilter`
Record:
- Executor
- Full command arguments, with sensitive data redacted
- Timestamp
- Whether it succeeded or failed
- Permission denial
- Affected player
- Result
- Whether executed from console or in-game
Also log GUI actions, punishment removals, reason changes, filter changes, reloads, and management overrides.
Keep a local audit trail even when Discord is unavailable.
Webhook requests must be asynchronous, with timeouts, rate-limit handling, and bounded retries. Never block the main server thread.
# 9. Free Automated Chat Moderation
Create a built-in automated chat moderation system.
It must be completely free to operate.
Do NOT require:
- OpenAI API keys
- Paid AI services
- External subscriptions
- Third-party moderation APIs
Implement a local, rule-based moderation engine with optional contextual heuristics.
Do not falsely describe this as a trained AI model. If a genuinely free, locally runnable model is supported, make it optional and disabled by default.
The moderation engine must detect:
- Configured prohibited words
- Common spelling variations
- Repeated characters
- Spam
- Flooding
- Excessive caps
- Advertising links
- Suspicious repeated messages
- Configurable bypass patterns
Support normalization of Unicode characters and common substitutions, while avoiding excessive false positives.
**Configurable actions per word or rule:**
- Allow
- Block message
- Warn player
- Notify staff
- Temporary mute
- Permanent mute
- Kick
- Escalate based on repeated violations
Example:
```yaml
chat-filter:
enabled: true
log-violations: true
default-action: BLOCK
words:
exampleword:
enabled: true
match-mode: WHOLE_WORD
action: WARN
reason: "Inappropriate Language"
notify-staff: true
forbiddenphrase:
enabled: true
match-mode: PHRASE
action: MUTE
duration: "1h"
reason: "Chat Filter Violation"
notify-staff: true
spam:
enabled: true
max-messages: 5
interval-seconds: 10
action: WARN
caps:
enabled: true
minimum-letters: 12
max-percentage: 80
action: BLOCK
```
The example words are placeholders, not actual prohibited words.
Use a default warning or message-blocking action rather than immediately banning players for uncertain matches.
**In-game filter commands:**
`/chatfilter addword [duration]`
`/chatfilter removeword `
`/chatfilter list`
`/chatfilter enable`
`/chatfilter disable`
`/chatfilter reload`
`/chatfilter info `
`/chatfilter setaction [duration]`
Changes made in-game must be saved to YAML immediately.
Support multiword phrases using quoted arguments.
Allow staff exemptions through permissions.
All automated actions must be logged with:
- Triggered rule
- Matched word or phrase
- Player
- Action taken
- Timestamp
- Whether the message was blocked
- Automated punishment ID, if created
Restrict sensitive chat content in Discord logs by default. Allow configurable redaction.
# 10. Punishment History & Lookup
Every punishment must be stored permanently.
Use files such as:
```text
plugins/UnstablePunish/
├── config.yml
├── reasons/
│ ├── bans.yml
│ ├── mutes.yml
│ ├── kicks.yml
│ └── warnings.yml
├── chat-filter.yml
├── messages.yml
├── gui.yml
├── webhooks.yml
├── permissions.yml
├── data/
│ ├── players/
│ ├── punishments/
│ └── indexes/
└── logs/
├── commands/
├── punishments/
├── chat-filter/
└── management/
```
Use safe file writes, caching, and asynchronous disk I/O where appropriate.
Prevent duplicate IDs and corrupted records.
Implement `/history ` as a paginated GUI displaying:
- All punishments
- Active punishments
- Expired punishments
- Removed punishments
- Punishment IDs
- Reasons
- Staff members
- Dates
- Durations
- Removal reasons
Support clickable punishment details.
Never delete historical punishment records when a player is unbanned or unmuted.
# 11. Offense Tracking
Create configurable escalation based on previous offenses.
Example:
First spam offense → 15-minute mute.
Second spam offense → 1-hour mute.
Third spam offense → 1-day mute.
Track offenses separately by punishment reason or configurable offense group.
Expired punishments must remain in history.
Support configurable offense reset periods, such as 30 or 90 days.
Staff must be able to view offense counts and manually correct them with a permission-controlled, logged command.
# 12. Permissions
```text
unstablepunish.punish
unstablepunish.ban
unstablepunish.tempban
unstablepunish.unban
unstablepunish.mute
unstablepunish.tempmute
unstablepunish.unmute
unstablepunish.kick
unstablepunish.warn
unstablepunish.history
unstablepunish.lookup
unstablepunish.logs
unstablepunish.reload
unstablepunish.reasons.manage
unstablepunish.chatfilter.manage
unstablepunish.chatfilter.bypass
unstablepunish.management.ban
unstablepunish.management.unban
unstablepunish.notify
unstablepunish.admin
```
All staff commands must require appropriate permissions.
The management permission must NOT automatically be given to ordinary moderators or administrators.
Support configurable punishment hierarchies so staff cannot punish users of equal or higher authority unless explicitly authorized.
Protect console access and prevent permission bypasses.
# 13. Additional Features
Implement these features:
**Silent punishments**
Allow `-s` on punishment commands.
Silent punishments should not broadcast publicly but must still be recorded and logged.
**Staff notifications**
Send online staff notifications when punishments occur.
**Punishment confirmation**
Optionally require confirmation before permanent bans and management bans.
**Offline punishments**
Support banning and muting offline players by UUID.
**Automatic expiration**
Automatically expire temporary bans and mutes, including when the server restarts.
**Staff notes**
Allow authorized staff to add internal notes to punishment records.
**Custom reasons**
Allow staff to select a predefined reason or enter a custom reason when permitted.
**Configuration reload**
Reload configurations without losing active punishments or requiring a full restart.
**Discord reliability**
Queue webhook events safely and retry temporary failures without creating duplicate logs.
# 14. Plugin Quality & Security
The plugin must:
- Never perform blocking file or HTTP operations on the main thread.
- Be safe against command injection and malformed user input.
- Validate durations and permissions.
- Sanitize Discord webhook content and mentions.
- Protect against YAML corruption.
- Handle player disconnects and server restarts.
- Avoid duplicate punishments from concurrent actions.
- Support safe reload behavior.
- Include useful console error messages.
- Avoid unnecessary dependencies.
- Be optimized for a busy multiplayer server.
- Avoid storing player IP addresses unless explicitly enabled.
- Restrict access to sensitive logs.
- Preserve a tamper-evident audit trail where practical.
# 15. Final Deliverables
Generate a complete, buildable Maven project.
Include:
1. Complete Java source code.
2. `plugin.yml`.
3. `pom.xml`.
4. All default YAML configuration files.
5. Fully functional punishment GUIs.
6. Ban, mute, kick, and warning systems.
7. Chat moderation engine.
8. Discord webhook integration.
9. Punishment history and unique ID system.
10. README with installation instructions.
11. Commands and permissions documentation.
12. Tests for punishment IDs, durations, escalation, permissions, and chat filter rules.
If the build environment supports Maven, compile the plugin and resolve compilation errors.
**IMPORTANT:** Do not stop after creating the project structure. Implement every system fully, including the GUIs, persistent storage, command executors, event listeners, logging, and webhook integration.
The final result must be a working Paper plugin suitable for deployment on Unstable SMP.