📄
pasted-code-1794757336909.txt
txt
582 lines
▶
Build ModerationX — Complete Minecraft Moderation Plugin
Act as a senior Minecraft plugin developer and software architect. Build a complete, production-ready Minecraft moderation plugin named ModerationX.
Do not create a basic demonstration or a collection of placeholder commands. Implement a fully functional, modular plugin with proper architecture, persistent storage, security, GUIs and LuckPerms integration.
1. Project specifications
- Plugin: ModerationX
- Minecraft: 1.21.11
- Platform: Paper
- Language: Java
- Build system: Gradle
- Permissions: LuckPerms API
- Database: SQLite and MySQL/MariaDB
- GUI: Bukkit Inventory API
- Configuration: YAML
- Optional integrations: PlaceholderAPI, DiscordSRV, WorldGuard and Vault
Use compatible, stable dependencies. Keep optional integrations optional.
Before writing code, inspect the existing project structure and preserve existing working functionality where possible.
2. Staff ranks and permissions
Create configurable LuckPerms-compatible permission groups.
Owner
- Full plugin access.
- All moderation commands.
- Database administration.
- Staff management.
- Permission management.
- Audit logs.
- Configuration management.
- Permission to override hierarchy restrictions.
Permission: moderationx.*
Co Owner
- Full moderation access.
- Ban, tempban, unban, mute and kick.
- All player inspection tools.
- Evidence and investigation management.
- Staff management.
- Reports management.
- Punishment history.
- Audit log access.
- Configuration reload.
Manager
- Full moderation management.
- Ban, tempban, unban, mute and kick.
- Staff notes and staff management.
- Reports and investigations.
- Evidence management.
- Punishment history.
- Moderation statistics.
- Jail management.
- Staff activity logs.
Staff Of The Week
- Recognition-only rank.
- No automatic moderation permissions.
- Must retain the actual permissions of the player's underlying staff rank.
- Must support temporary assignment.
Admin
- Ban and temporary ban.
- Unban.
- Kick.
- Warn.
- Mute and tempmute.
- Inventory inspection.
- Ender Chest inspection.
- Freeze and unfreeze.
- Player history.
- Reports and investigations.
- Evidence management.
- Jail management.
- Staff notifications.
Junior Admin
- Temporary bans.
- Kick and warn.
- Mute and tempmute.
- Inventory and Ender Chest inspection.
- Freeze and unfreeze.
- Reports.
- Evidence viewing.
- Player history.
- Basic investigation access.
Developer
- Technical diagnostics.
- Plugin information.
- Authorized configuration reload.
- Database diagnostics.
- Plugin debug logs.
- Technical inspection tools.
- No automatic punishment permissions.
- No automatic staff management permissions.
Moderator
- Warn.
- Kick.
- Mute and tempmute.
- Freeze and unfreeze.
- Inventory and Ender Chest inspection.
- Reports and report management.
- Evidence viewing.
- Player history.
- Staff chat.
Staff
- Warn.
- Kick.
- Report management.
- Basic player inspection.
- Staff chat.
- Player history with restricted access.
Trail Staff
- Warn.
- Basic report handling.
- Staff chat.
- Limited player inspection.
- Configurable punishment restrictions.
Guests
- No moderation permissions.
Helper
- View reports.
- Claim reports.
- Add internal report notes.
- Assist players.
- Staff chat.
- No punishment permissions.
3. LuckPerms integration
Use the official LuckPerms API.
Never identify staff authority through display names, prefixes or tab-list formatting.
Create independent permission nodes for every command and feature.
Implement:
- Automatic permission checking.
- Group inheritance compatibility.
- Custom permission assignment.
- Permission checks for GUI interactions.
- Staff hierarchy protection.
- Configurable punishment duration limits.
- Equal-rank and higher-rank protection.
- Owner override.
- Permission-based evidence access.
Staff Of The Week must work as an additional parent group without replacing the actual staff group.
Do not hardcode staff permissions into Java classes.
4. Punishment management
Implement:
- /warn
- /warns
- /unwarn
- /kick
- /ban
- /tempban
- /unban
- /baninfo
- /banlist
- /mute
- /tempmute
- /unmute
- /muteinfo
- /history
- /checkpunish
- /punish
Every punishment must have:
- Unique punishment ID.
- Player UUID and name.
- Staff UUID and name.
- Punishment type.
- Reason.
- Evidence URL where applicable.
- Creation timestamp.
- Expiration timestamp.
- Active or expired status.
Evidence must be mandatory for bans and temporary bans by default.
Allow configurable punishment templates and durations.
Implement automatic expiration, offline punishment support, warning escalation, punishment appeals and rollback with an audit record.
Never permanently delete punishment history through ordinary commands.
5. Advanced chat moderation
Implement:
- /clearchat
- /slowchat
- /unslowchat
- /lockchat
- /unlockchat
- /mutechat
- /unmutechat
- /chatspy
- /socialspy
- /ignore
- /unignore
- /staffbroadcast
- /staffchat
Automatic moderation:
- Anti-spam.
- Repeated messages.
- Advertising detection.
- Blocked words.
- Caps spam.
- Unicode spam.
- Chat cooldown.
- Configurable automatic warnings.
Avoid automatically issuing permanent punishments through chat filters.
6. Player investigation
Implement:
- /invsee
- /endersee
- /armorsee
- /potions
- /ping
- /whois
- /playtime
- /firstjoin
- /lastseen
- /freeze
- /unfreeze
- /inspect
Requirements:
- Read-only inventory inspection by default.
- Log every inspection.
- Freeze notifications.
- Protect frozen players from movement and interaction.
- Log authorized inventory edits.
- Support offline player history.
- Use UUIDs as identifiers.
7. Staff tools
Implement:
- /staffmode
- /vanish
- /stafflist
- /staffchat
- /staffhelp
- /staffinfo
- /staffnote
- /staffnotes
- /staffhistory
- /modstats
- /modlog
- /staffreport
- /modreload
Staff mode should include:
- Automatic vanish.
- Protected staff inventory.
- Separate staff inventory.
- Join and quit notifications.
- Staff-only notifications.
- Inspection tools.
- Activity logging.
8. Reports system
Implement:
- /report
- /reports
- /reportinfo
- /reportclaim
- /reportclose
- /reportreopen
- /reportlist
Report statuses:
- Pending.
- Claimed.
- Under Investigation.
- Resolved.
- Rejected.
Store reporter, reported player, reason, evidence, assigned staff member and timestamps.
Prevent report spam and duplicate active reports where appropriate.
9. Investigation cases
Implement:
- /case create
- /case view
- /case assign
- /case evidence
- /case note
- /case close
- /case list
Support multiple evidence entries, internal notes, assigned staff and linked punishment IDs.
10. Jail system
Implement:
- /jail
- /unjail
- /jailinfo
- /setjail
- /deljail
Features:
- Configurable jail locations.
- Multiple jail locations.
- Temporary confinement.
- Automatic release.
- Offline player support.
- Jail history.
- Permission restrictions.
- Optional WorldGuard compatibility.
11. Additional moderation features
Implement:
- /ipban
- /kickall
- /blacklist
- /unblacklist
- /invlock
- /alts
- /historysearch
- /punishmentsearch
Sensitive account-linking and connection information must be restricted to explicitly authorized administrators. Never expose private connection information to ordinary staff.
12. GUI system
Create fully functional and configurable GUIs:
1. Main ModerationX menu.
2. Player management.
3. Player inspection.
4. Punishment selection.
5. Punishment history.
6. Evidence viewer.
7. Report management.
8. Staff management.
9. Investigation cases.
10. Jail management.
11. Moderation statistics.
GUI requirements:
- Configurable titles.
- Configurable item names.
- Configurable lore.
- Configurable item slots.
- Configurable materials.
- Pagination.
- Back buttons.
- Permission-based visibility.
- Click protection.
- Proper inventory cleanup.
- No unauthorized actions through GUI manipulation.
Use a consistent professional Minecraft GUI style.
13. Database
Support both SQLite and MySQL/MariaDB.
Create persistent storage for:
- Players.
- Punishments.
- Warnings.
- Evidence.
- Staff logs.
- Reports.
- Investigation cases.
- Staff notes.
- Jail records.
- Inventory inspection logs.
Requirements:
- UUID-based identification.
- Prepared SQL statements.
- Database connection pooling where appropriate.
- Asynchronous database operations.
- Database migrations.
- Automatic temporary punishment expiration.
- Backup functionality.
- Graceful database failure handling.
Do not block the Minecraft main server thread with database operations.
14. PlaceholderAPI
Provide placeholders for:
- %moderationx_warns%
- %moderationx_bans%
- %moderationx_mutes%
- %moderationx_reports%
- %moderationx_staff_online%
- %moderationx_playtime%
- %moderationx_punishment_count%
Only expose player-specific placeholders where appropriate.
15. Configuration structure
Generate separate configuration files:
- config.yml
- messages.yml
- permissions.yml
- punishments.yml
- staff-ranks.yml
- chat-moderation.yml
- reports.yml
- evidence.yml
- staff-mode.yml
- jail.yml
- database.yml
GUI configurations:
- gui/main-menu.yml
- gui/player-menu.yml
- gui/punishment-menu.yml
- gui/reports-menu.yml
- gui/staff-menu.yml
- gui/inspection-menu.yml
All messages must support configurable colors, MiniMessage formatting and Unicode symbols.
16. Security requirements
These requirements are mandatory:
- Every command must check permissions.
- Every GUI action must recheck permissions.
- Prevent unauthorized punishment of equal or higher ranks.
- Owner override must be explicitly controlled.
- Prevent self-punishment.
- Log every punishment.
- Log inventory inspections.
- Log sensitive staff actions.
- Never silently delete audit records.
- Validate evidence URLs.
- Prevent command injection and SQL injection.
- Protect against duplicate punishment execution.
- Handle offline players safely.
- Persist temporary punishments across restarts.
- Keep database work asynchronous.
- Do not trust client-provided GUI actions.
- Provide configurable access to sensitive data.
17. Code architecture
Use a clean modular Java architecture.
Suggested packages:
com.moderationx
- ModerationX
- commands
- commands.punishments
- commands.staff
- commands.investigation
- commands.reports
- commands.chat
- listeners
- permissions
- integrations
- database
- database.repositories
- punishments
- evidence
- reports
- cases
- inventory
- staff
- jail
- gui
- placeholders
- configuration
- utilities
- logging
Use interfaces and services where appropriate. Avoid putting all functionality into one main class.
18. Development requirements
Follow this implementation order:
1. Project architecture and plugin initialization.
2. LuckPerms integration.
3. Permission system and staff hierarchy.
4. Database abstraction and migrations.
5. Punishment management.
6. Evidence system.
7. Player inspection.
8. Chat moderation.
9. Staff management.
10. Reports and investigations.
11. Jail system.
12. GUI implementation.
13. PlaceholderAPI integration.
14. Testing and optimization.
Compile and test each module before moving to the next.
Do not create fake implementations, empty command handlers, TODO-only classes or placeholder GUIs.
Every advertised feature must work.
If a feature cannot be implemented correctly, explain the limitation rather than pretending it works.
19. Final deliverables
Provide:
1. Complete Java source code.
2. Gradle build files.
3. plugin.yml.
4. All default configuration files.
5. Database schema and migration system.
6. README.md with installation instructions.
7. LuckPerms setup commands for all staff groups.
8. Full command and permission documentation.
9. Testing instructions.
10. A compiled ModerationX.jar.
The final plugin must compile successfully and be ready to install on a Paper 1.21.11 server.
Most important: Prioritize reliability, security, clean architecture, configurable permissions and a professional staff experience. Build a real moderation system, not just a command collection.
📄
pasted-code-1794757510475.txt
txt
133 lines
▶
Writing
20. Professional GUI design — Unicode and visual styling
I want ModerationX GUIs to look polished, modern and professional. Do not use plain default-looking inventory menus.
Unicode styling
Use suitable Unicode symbols throughout GUI titles, item names, lore and messages.
Examples of symbols:
◆ ◈ ◇
● ○ ◎
➜ ➥ ➤
✦ ✧ ★
✔ ✘ ⚠
⌂ ⚙ ⚒
⛨ ⚖
▸ ▹ ▪ ▫
Use these symbols consistently and avoid randomly mixing too many different styles.
GUI design requirements
Use MiniMessage formatting.
Use gradient colors where supported.
Use consistent color coding for different moderation actions.
Use Unicode symbols in item names and lore.
Use clean spacing and readable descriptions.
Use decorative separators where appropriate.
Use dark-themed inventory backgrounds.
Use clear navigation buttons.
Use professional pagination.
Make all titles and lore configurable.
Suggested color scheme:
Main interface: Dark gray and aqua.
Successful actions: Green.
Warnings: Yellow.
Punishments: Red.
Information: Aqua.
Staff management: Purple.
Navigation: Gray and white.
Example GUI item formatting:
Punishment menu:
&c&l⚖ Punishments
&e◆ Select a punishment
&7Choose an action for this player.
Player inspection:
&b&l◈ Player Inspector
&7◆ Inventory
&7◆ Ender Chest
&7◆ Player Information
&7◆ Punishment History
Report menu:
&6&l⚠ Reports
&e◆ Pending Reports
&a◆ Claimed Reports
&c◆ Resolved Reports
Use MiniMessage gradients for selected headings, but make sure all formatting renders correctly in Minecraft 1.21.11.
Do not sacrifice readability for decoration.
21. Automatically generated isolated jail system
Completely change the jail system design.
I do NOT want administrators to manually build a jail or configure its coordinates.
ModerationX must automatically generate a dedicated jail structure in a safe, isolated location.
Jail generation
When the plugin initializes or when the first jail is needed:
Find or generate a suitable isolated location.
Generate a complete enclosed jail structure.
Ensure the location is far away from normal survival gameplay.
Prevent ordinary players from discovering or accessing the jail.
Save the generated location and structure information.
Reuse the same jail instead of generating a new one every time.
The jail must be generated in a safe, controlled environment, preferably in a dedicated jail world or isolated protected region.
Jail structure
Generate a professional prison-style structure with:
Fully enclosed walls.
Secure ceiling and floor.
Individual jail cells.
Central guard area.
Secure entrance.
Lighting.
Separate cells for different prisoners.
Safe spawn points.
A staff observation area.
Use vanilla Minecraft blocks by default. Do not require resource packs.
Jail commands
Implement:
/jail
/unjail
/jailinfo
/jail list
/jail generate
/jail regenerate
/jail setspawn
/jail tp
/jail status
Jail behavior
When a player is jailed:
Teleport them to an available cell.
Record their original location.
Record the staff member, duration and reason.
Prevent them from escaping the jail.
Restrict teleportation and unauthorized movement.
Prevent unauthorized block interaction.
Prevent unauthorized inventory interaction.
Automatically release them when their sentence expires.
Restore their original location when released, provided it is safe.
Support offline players and server restarts.
Jail security
Protect the entire jail region.
Prevent block breaking and placing.
Prevent ender pearl escapes.
Prevent unauthorized teleportation.
Prevent unauthorized flight and movement exploits.
Prevent unauthorized vehicle escapes.
Do not allow jailed players to use ordinary teleport commands.
Only authorized staff can enter the jail.
Do not let normal players discover the jail through commands or navigation.
Multiple prisoners
Support multiple prisoners simultaneously.
Assign each prisoner a separate available cell.
Never teleport two prisoners into the same cell.
Automatically free cells after release.
Handle server restarts without losing jail assignments.
Regeneration safety
The /jail regenerate command must require high-level permission.
Before regenerating:
Check whether prisoners are currently inside.
Prevent accidental deletion of occupied cells.
Preserve existing prisoner records.
Require confirmation.
Back up existing jail configuration.
Technical requirements
Use persistent storage for generated coordinates and prisoner assignments.
Do not generate a new jail on every server startup.
Avoid loading unnecessary chunks.
Generate structures asynchronously where safe, while performing Bukkit world modifications on the main server thread.
Handle missing or deleted jail worlds.
Support Paper 1.21.11.
Do not depend on external schematic files.
The final jail should be a self-contained, automatically generated prison system that requires almost no manual setup.
Created an initial reports-only implementation with SQLite storage, asynchronous database operations, permissions, duplicate detection, and report commands.
This is not the complete ModerationX plugin. Punishments, LuckPerms hierarchy, jail, GUIs, integrations, audit logging, and the other requested systems remain unimplemented. Compilation and testing have not been verified, and no compiled jar was produced in this response.
Make the complete ModerationX plugin
Add a persistent audit trail for report creation and status changes.
Add a permission-protected command to inspect that trail.
Preserve the existing reports and their data.
Added a persistent audit trail for report creation and status changes, plus /reportaudit <id> with its own permission.
ModerationX is still incomplete and not production-ready. Punishments, LuckPerms hierarchy, the generated jail, GUIs, MySQL, integrations, and other requested systems remain unimplemented. Compilation and testing were not verified.
Fully complete it
Preserve the existing reports and audit data.
Add a fail-closed punishment core with LuckPerms hierarchy checks, persistent history, and asynchronous database access.
Register the implemented commands and document what remains incomplete.
Added /warn, /kick, and /history, with SQLite records and LuckPerms weight checks for staff hierarchy.
ModerationX is still incomplete and not production-ready. Bans, mutes, the generated jail, GUIs, MySQL, and many other requested features remain unimplemented. Compilation and testing have not been verified.
package com.moderationx;
import com.moderationx.reports.ReportCommands;
import com.moderationx.reports.ReportStore;
import com.moderationx.punishments.PunishmentCommands;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.File;
public final class ModerationX extends JavaPlugin {
private ReportStore store;
private PunishmentCommands punishments;
@Override
public void onEnable() {
saveDefaultConfig();
if (!getDataFolder().exists() && !getDataFolder().mkdirs()) {
getLogger().severe("Could not create the plugin data folder.");
getServer().getPluginManager().disablePlugin(this);
return;
}
store = new ReportStore(this, new File(getDataFolder(), "moderationx.db"));
ReportCommands commands = new ReportCommands(this, store);
for (String name : new String[]{"report", "reports", "reportinfo", "reportclaim", "reportclose", "reportreopen", "reportaudit"}) {
getCommand(name).setExecutor(commands);
}
store.initialize();
punishments = new PunishmentCommands(this, new File(getDataFolder(), "punishments.db"));
for (String name : new String[]{"warn", "kick", "history"}) {
getCommand(name).setExecutor(punishments);
}
}
@Override
public void onDisable() {
if (store != null) store.close();
if (punishments != null) punishments.close();
}
}