_drayx__

version 1.21.11

📎 1 file 14,320 chars
📄
pasted-code-1787040945024.txt
txt 701 lines
▶
You are an expert Java Minecraft Paper plugin developer.

Build a complete, production-ready advanced punishment plugin called AdvancedPunish for Minecraft Paper 1.21.11.

IMPORTANT OUTPUT STYLE RULE:

The final output must look like it was written by a professional human developer, NOT like an AI-generated document.

Do NOT use Markdown headings.

Do NOT use #, ##, ###, or any other Markdown heading syntax.

Do NOT add unnecessary AI-style introductions, conclusions, explanations, motivational text, or filler.

Do NOT write things such as:

"Sure!"
"Absolutely!"
"Here is your complete project!"
"Let's get started!"
"I hope this helps!"
"Note:"
"Important:"
"AI-generated"
"Below is..."
"Here is what I created..."

Do not use decorative Markdown section headings.

Do not use excessive emoji.

Do not add unnecessary separators just to make the response look like an AI response.

Keep comments in the source code professional and minimal.

The generated project itself should look like it was written by an experienced Minecraft plugin developer.

Use normal file names and code blocks.

When showing the project structure, use a plain code block.

When showing commands, use plain code blocks.

When showing source files, clearly identify the filename using a simple line such as:

File: src/main/java/com/example/advancedpunish/AdvancedPunishPlugin.java

Do not turn the filename into a Markdown heading.

Do not put # characters in front of filenames.

Do not use Markdown headings anywhere in the generated answer.

The plugin must target exactly:

Minecraft 1.21.11
Paper
Java version appropriate for Paper 1.21.11

The plugin name must be:

AdvancedPunish

Plugin version:

1.0.0

The plugin must be complete and compile successfully.

Generate the entire project from scratch, including:

build.gradle
settings.gradle
gradle.properties
gradle wrapper
plugin.yml
config.yml
messages.yml
INVENTORY GUI.yml
punishments.yml
database.yml
discord.yml
README
all Java source files
all required resources
tests where appropriate

Do not use pseudocode.

Do not use TODO.

Do not omit code.

Do not write "rest of code omitted".

Do not write "implement this yourself".

Every required file must contain complete working code.

The project must be ready to build.

The user is on Windows, so provide one complete PowerShell bootstrap script that creates the entire project automatically.

The PowerShell script must:

Create the project directory.

Create every required directory.

Create every required source file.

Create every required resource file.

Create the Gradle files.

Create the plugin.yml.

Create all configuration files.

Create the Gradle wrapper if necessary.

Build the project.

Show the final JAR location.

The user should not have to manually create any file.

The final JAR should be generated inside:

build/libs/

The plugin must support these punishment types:

WARN
KICK
MUTE
TEMPMUTE
BAN
TEMPBAN
IPBAN
TEMPIPBAN
IPMUTE
JAIL
FREEZE
UNFREEZE
UNBAN
UNMUTE
UNJAIL
BLACKLIST
UNBLACKLIST
SOFTBAN
NOTE

Every punishment must store:

unique punishment ID
target UUID
target name
staff UUID
staff name
punishment type
reason
creation timestamp
expiration timestamp
active status
revoked status
revoking staff
revocation reason
revocation timestamp
optional evidence
server name

Use UUIDs internally.

Implement these commands:

/punish 
/punish  

/ban  
/tempban   

/mute  
/tempmute   

/warn  

/kick  

/unban  [reason]
/unmute  [reason]

/ipban  
/tempipban   

/ipmute  

/jail   
/unjail 

/freeze  [reason]
/unfreeze 

/blacklist  
/unblacklist 

/softban  [reason]

/history 
/history  

/punishments 
/punishinfo 
/punishrevoke  

/note  
/notes 
/delnote 

/alts 

/stafflog
/stafflog 

/setjail 
/deljail 

/punish notifications
/punish version
/punishhelp
/punishreload

Implement complete tab completion.

When /punish  is used, open a professional INVENTORY GUI containing the player's head, name, UUID, current punishment status, warning count, mute count, ban count, punishment history, and buttons for Warn, Kick, Mute, TempMute, Ban, TempBan, IP Ban, Jail, Freeze, History, Notes, and Revoke.

Make INVENTORY GUI titles, slots, materials, names, lore, sounds, and layout configurable.

Implement a powerful duration parser supporting:

30s
10m
2h
3d
2w
1mo
1y

and combinations such as:

1d12h30m
2h30m
7d
1w2d6h

Temporary punishments must automatically expire.

TempMute must restore chat access.

TempBan must restore join access.

TempJail must release the player.

TempFreeze must unfreeze the player.

Expiration must survive server restarts.

Implement a complete ban system.

When a banned player joins, prevent login and show a professional dark-red ban message containing:

player
reason
punishment ID
expiration
appeal URL

Implement a complete mute system.

Muted players must not be able to use normal chat or common messaging commands.

Allow configurable commands while muted.

Implement a freeze system.

Frozen players should not be able to move, teleport, attack, break blocks, place blocks, drop items, pickup items, or interact unless explicitly allowed by configuration.

Implement a jail system with multiple configurable jail locations.

Jailed players must remain jailed after reconnecting and after server restarts.

Implement configurable punishment escalation.

For example:

1 warning = warning
2 warnings = 10 minute mute
3 warnings = 1 hour mute
4 warnings = 1 day ban
5 warnings = 7 day ban

Make warning expiration and escalation completely configurable.

Every punishment must support a public server-wide broadcast.

This is mandatory.

When a player is punished, every online player must see the punishment in chat.

The broadcast must use a professional dark-red design.

Use the modern Paper Adventure API and MiniMessage where appropriate.

The primary color must be dark red.

Use:



Do not rely on legacy § formatting internally when Adventure components can be used.

Example:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚔ PUNISHMENT ⚔
{player} has been {punishment}.
Reason: {reason}
Duration: {duration}
Staff: {staff}
Punishment ID: #{id}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The complete broadcast should be configurable through messages.yml.

Support:

hover text
click events
bold text
sounds
separators

Hovering over the player can show punishment information.

Clicking the player or punishment ID can optionally execute /punishinfo .

Create a broadcasts section in config.yml containing:

broadcasts:
enabled: true
color: ""
ban: true
tempban: true
mute: true
tempmute: true
warn: true
kick: true
ipban: true
tempipban: true
ipmute: true
jail: true
freeze: true
unban: true
unmute: true
unjail: true
unfreeze: true
blacklist: true
unblacklist: true
softban: true
show-staff: true
show-reason: true
show-duration: true
show-punishment-id: true
sound:
enabled: true
type: "BLOCK_ANVIL_LAND"
volume: 0.7
pitch: 1.0

Every configuration option must actually work.

Create messages.yml containing customizable broadcasts for every punishment type.

Keep the entire visual design consistent.

Use dark red for:

public punishment broadcasts
ban screens
mute messages
warning messages
freeze messages
jail messages
punishment INVENTORY GUI
punishment history
punishment information
staff notifications
confirmation messages

Support offline punishments.

A staff member must be able to punish a player who is offline.

Use stored UUID and player name information.

Public broadcasts should still work for offline targets.

Create separate staff-only notifications using:

punish.notify

Example:

[Staff] Admin punished Steve: TEMPBAN 7d — Griefing

Public broadcasts must remain visible to everyone and must not require a permission.

Implement complete punishment history.

Support pagination.

Show:

punishment ID
type
reason
staff
creation time
duration
expiration
status
revocation information

Implement:

/punishinfo 

Show all details for that punishment.

Implement:

/punishrevoke  

Record who revoked the punishment, why, and when.

Optionally broadcast revocations.

Support SQLite, MySQL, and MariaDB.

Use an abstraction layer.

Database operations must be asynchronous.

Use connection pooling for MySQL and MariaDB.

Never block the Minecraft main thread with database queries.

Use prepared statements.

Prevent SQL injection.

Create database tables for:

players
punishments
notes
staff_logs
ip_associations
jails
staff_preferences

Implement player notes.

Implement a complete staff audit log.

Record every moderation action.

Support detailed permission nodes including:

punish.warn
punish.kick
punish.mute
punish.tempmute
punish.ban
punish.tempban
punish.ipban
punish.tempipban
punish.ipmute
punish.jail
punish.freeze
punish.blacklist
punish.softban
punish.history
punish.notes
punish.revoke
punish.stafflog
punish.reload
punish.version
punish.notify
punish.bypass
punish.bypass.mute
punish.bypass.ban
punish.admin

Integrate with Vault and LuckPerms when available.

Prevent lower-ranked staff from punishing higher-ranked staff.

Make staff hierarchy configurable.

Prevent self-punishment unless explicitly enabled.

Implement punishment templates.

Example:

templates:
spam:
type: MUTE
duration: 10m
reason: "Spamming"

advertising:
type: BAN
duration: 7d
reason: "Advertising"

cheating:
type: BAN
duration: 30d
reason: "Cheating"

Support:

/punish  template