Create a Paper 26.2 plugin called Punish with a /punish command for staff.
/punish <player> opens a punishment GUI. Staff can select a punishment reason and duration, then confirm the punishment.
Include these punishment reasons:
Cheating / Client:
- Hacked Client — 13 days for first time, 30 for next time, 60 and next time, Permant days
- X-Ray / ESP — 13 days for first time, 30 for next time, 60 and next time, Permant days
- Baritone / Automation — 30 days
- Freecam — 30 days
- Fly / Movement Cheats — 30 days
- KillAura / Combat Cheats — 30 days
- Auto Clicker / Macros — 13 days for first time, 30 days for next time.
- Other Unfair Advantage — 60 days
Exploits:
- Duplication — Permanent
- Attempted Duplication — 60 days
- Bug / Exploit Abuse — 30 days
- Server Seed Abuse — Permanent
Economy:
- IRL Trading — 30 days
- Cross-Server Trading — 60 days
- Selling/Buying Accounts — 60 days
- Selling/Buying Items or Currency outside approved channels — 60 days
- Discord Boost/Invite Rewards for in-game benefits — 30 days
Staff / Account:
- Staff Impersonation — 30 days
- Ban Evasion — Permanent
- Excessive Alt Accounts — 30 days
Other:
- Harassment / Severe Disruption — configurable
- Other — configurable
ALL punishment reasons and durations must be configurable in config.yml.
When a punishment is confirmed:
- Save the player's UUID, username, reason, duration, staff member, timestamp and punishment ID.
- Wipe the player's server data according to the configured wipe settings, including money, inventory, ender chest, claims/bases where supported, statistics, progression and other configured player data.
- Ban the player with the selected reason and duration.
- Disconnect the player if they are online.
- Log the punishment to the console.
- Make the ban reason visible when the player attempts to join.
The punishment should display something similar to:
You have been banned from the server.
Reason: X-Ray / ESP Duration: 60 days
[gray]If you think this is a false ban, Appeal at https://discord.gg/wxzj8hrDP.[/gray]
Make the appeal message gray.
IMPORTANT:
- Do not automatically punish players from this plugin.
- Only staff with the correct permission can use /punish.
- Require a confirmation button before applying a punishment.
- Add a configurable permission such as punish.use.
- Add punish.reload for configuration reloads.
- Make all reasons, durations, messages and wipe options configurable.
- Include a punishment history/log system.
- Do not claim this is an official DonutSMP plugin
Create the Gradle Paper plugin scaffold and plugin metadata.
Add configurable punishment definitions, messages, wipe settings, and appeal text.
Implement punishment persistence, history, wiping, banning, disconnects, and logging.
Add the staff command, reload/history subcommands, and confirmation-based GUI.
Implemented the new Punish Paper plugin with:
/punish <player>staff GUIConfigurable punishment categories, reasons, and durations
Required confirmation step before punishment
Persistent punishment history in
punishments.yml/punish history <player>/punish reloadConfigurable permissions:
punish.usepunish.reload
Configurable ban messages and gray appeal text
Configurable wiping for:
Inventory
Ender chest
Experience and levels
Statistics
Advancements
Money commands
Claims/base commands
Other player-data commands
Ban application with duration and reason
Online player disconnect handling
Console punishment logging
Configurable GUI materials and text
No automatic punishment behavior
Can you make it that it shows /punish username and like xray, esp , bartionte or whatever
Updated the punishment GUI so /punish <username> clearly shows:
Target username on every GUI screen
Categories such as Cheating / Client
Reasons including:
Hacked Client
X-Ray / ESP
Baritone / Automation
Freecam
Fly / Movement Cheats
KillAura / Combat Cheats
Auto Clicker / Macros
Selected reason and duration
Target, reason, and duration on the confirmation screen
Usage:
/punish username
The reason names and durations still come from config.yml, so they remain fully configurable.
Remove the like gui it shows for /punish and just it shows like /punish [username] [Reason] [duration into mins hours days]
Replace the GUI flow with
/punish <player> <reason> <duration>.Support configurable reason keys/names plus durations such as
30m,2h,60d, andpermanent.Preserve the safety confirmation using
/punish confirm.Remove GUI registration and update usage/tab completion.
Removed the punishment GUI. Staff now use:
/punish <username> <reason> <duration>
Examples:
/punish Steve xray_esp 60d
/punish Steve xray 60 days
/punish Steve baritone 30d
/punish Steve killaura 2h
/punish Steve duplication permanent
/punish Steve harassment_disruption 30m
Supported duration formats:
30m
2h
60d
1 week
permanent
Reasons can use their configurable key, such as:
xray_esp
baritone_automation
killaura_combat
autoclicker_macros
duplication
ban_evasion
For safety, the command displays the pending punishment first. Apply it with:
/punish confirm
The old GUI files and GUI registration were removed.
Can you do it that when you enter /punish [username] [reason] [duration] It pops up a gui with a green panel and red panel, green one is confirm and red one is decline, and add /unpunish [username]
Add a confirmation GUI after
/punish <username> <reason> <duration>, with green confirm and red decline panels.Add
/unpunish <username>with permission checks and configurable messages.
Implemented.
Punishment confirmation GUI
After entering:
/punish <username> <reason> <duration>
A GUI opens with:
Green panel: Confirm Punishment
Red panel: Decline Punishment
Center details showing:
Player
Reason
Duration
Clicking the green panel applies the punishment. Clicking the red panel cancels it. Closing the GUI also cancels the pending punishment.
Unpunish command
Added:
/unpunish <username>
Permission:
punish.unpunish
It removes the player’s active ban and logs who removed it. Messages and GUI text are configurable in config.yml.
The compilation failed with this error:
Compilation failed with 2 error(s):
ERROR in src/main/java/com/kodari/punish/PunishmentManager.java at line 86: incompatible types: Object cannot be converted to String
for (String entryName : banList.getBanEntries()) {
^
ERROR in src/main/java/com/kodari/punish/UnpunishCommand.java at line 63: incompatible types: BanEntry cannot be converted to String
for (String bannedName : Bukkit.getBanList(BanList.Type.NAME).getBanEntries()) {
^
=== COMPILATION ERROR ANALYSIS ===
TYPE MISMATCHES:
- incompatible types: Object cannot be converted to String
- incompatible types: BanEntry cannot be converted to String
ACTION: Fix variable types or casting
FILES TO INVESTIGATE:
- src/main/java/com/kodari/punish/PunishmentManager.java
- src/main/java/com/kodari/punish/UnpunishCommand.java
Please fix this error by creating a new artifact with the corrected code.
Fixed the compilation errors by using the typed Bukkit ban APIs:
BanList<String>instead of rawBanListBanEntry<String>when iterating ban entriesentry.getTarget()to retrieve the banned username
Updated:
src/main/java/com/kodari/punish/PunishmentManager.java
src/main/java/com/kodari/punish/UnpunishCommand.java
This resolves both Object cannot be converted to String and BanEntry cannot be converted to String errors.
Can you add all of these reasons and durations, and make it you dont put the durations yourself but it uses the durations that I gave you, this is from config file permissions: use: punish.use reload: punish.reload unpunish: punish.unpunish
messages: no-permission: '&cYou do not have permission to use this command.' player-only: '&cOnly a player can issue a punishment.' player-not-found: '&cThat player has not joined this server.' usage: '&e/punish <player> <reason> &7| &e/punish confirm &7| &e/punish history [player] &7| &e/punish reload' unpunish-usage: '&e/unpunish <player>' invalid-reason: '&cUnknown punishment reason. Use &e/punish <player> <reason>&c.' confirmation: '&eReview punishment: &f%player% &7- &f%reason% &7- &f%duration%&e. Type &f/punish confirm &eto apply it.' nothing-to-confirm: '&cYou have no pending punishment to confirm.' reload: '&aPunish configuration reloaded.' cancelled: '&7Punishment cancelled.' applied: '&aPunishment #%id% applied to %player%.' unpunished: '&a%player% has been unpunished.' not-punished: '&e%player% is not currently punished.' history-empty: '&7No punishment history was found.' history-header: '&ePunishment history for %player%:' history-entry: '&7#%id% &f%reason% &7- %duration% &8by &f%staff% &8(%timestamp%)' appeal: 'https://discord.gg/wxzj8hrDP'
ban-screen: - '&cYou have been banned from the server.' - '' - '&fReason: &e%reason%' - '&fDuration: &e%duration%' - '' - '&7If you think this is a false ban, Appeal at %appeal%.'
gui: title: '&8Confirm punishment'
confirm-name: '&aConfirm Punishment' confirm-lore: - '&7Player: &f%player%' - '&7Reason: &f%reason%' - '&7Duration: &f%duration%' - '' - '&aClick to confirm'
decline-name: '&cDecline Punishment' decline-lore: - '&7Player: &f%player%' - '&7Reason: &f%reason%' - '&7Duration: &f%duration%' - '' - '&cClick to decline'
details-name: '&ePunishment Details' details-lore: - '&7Player: &f%player%' - '&7Reason: &f%reason%' - '&7Duration: &f%duration%'
wipe: inventory: true ender-chest: true
money: enabled: false commands: []
statistics: true advancements: true
claims: enabled: false commands: []
player-data-commands: []
punishments:
# ========================================== # CHEATING / UNFAIR ADVANTAGES # ==========================================
cheating: name: 'Cheating / Unfair Advantage'
reasons:
hacked_client: name: 'Hacked Client' duration: name: '30 days' days: 30
xray_esp: name: 'X-Ray / ESP' duration: name: '30 days' days: 30
baritone_automation: name: 'Baritone / Automation' duration: name: '30 days' days: 30
freecam: name: 'Freecam' duration: name: '14 days' days: 14
fly_movement: name: 'Fly / Movement Cheats' duration: name: '30 days' days: 30
killaura_combat: name: 'KillAura / Combat Cheats' duration: name: '30 days' days: 30
autoclicker_macros: name: 'Auto Clicker / Macros' duration: name: '14 days' days: 14
inventory_mods: name: 'Inventory Mods' duration: name: '14 days' days: 14
reach: name: 'Reach / Hitbox Modification' duration: name: '30 days' days: 30
scaffold: name: 'Scaffold / Auto Bridging' duration: name: '30 days' days: 30
speed: name: 'Speed Cheats' duration: name: '30 days' days: 30
no_knockback: name: 'No Knockback' duration: name: '30 days' days: 30
other_unfair_advantage: name: 'Other Unfair Advantage' duration: name: '14 days' days: 14
# ========================================== # EXPLOITS / BUG ABUSE # ==========================================
exploits: name: 'Exploits / Bugs'
reasons:
duplication: name: 'Duplication' duration: name: '60 days' days: 60
attempted_duplication: name: 'Attempted Duplication' duration: name: '30 days' days: 30
bug_exploit_abuse: name: 'Bug / Exploit Abuse' duration: name: '14 days' days: 14
server_seed_abuse: name: 'Server Seed Abuse' duration: name: '60 days' days: 60
exploit_distribution: name: 'Sharing / Distributing Exploits' duration: name: '30 days' days: 30
exploit_advertising: name: 'Advertising Exploits' duration: name: '14 days' days: 14
# ========================================== # ECONOMY / TRADING # ==========================================
economy: name: 'Economy / Trading'
reasons:
irl_trading: name: 'IRL Trading' duration: name: '60 days' days: 60
cross_server_trading: name: 'Cross-Server Trading' duration: name: '30 days' days: 30
selling_buying_accounts: name: 'Selling/Buying Accounts' duration: name: '30 days' days: 30
outside_channels: name: 'Selling/Buying Items or Currency outside approved channels' duration: name: '30 days' days: 30
discord_rewards: name: 'Discord Boost/Invite Rewards for in-game benefits' duration: name: '14 days' days: 14
economy_exploit: name: 'Economy Exploitation' duration: name: '30 days' days: 30
# ========================================== # STAFF / ACCOUNT # ==========================================
staff_account: name: 'Staff / Account'
reasons:
staff_impersonation: name: 'Staff Impersonation' duration: name: '14 days' days: 14
ban_evasion: name: 'Ban Evasion' duration: name: '60 days' days: 60
excessive_alt_accounts: name: 'Excessive Alt Accounts' duration: name: '14 days' days: 14
account_sharing: name: 'Account Sharing' duration: name: '14 days' days: 14
punishment_abuse: name: 'Punishment / Moderation Abuse' duration: name: '30 days' days: 30
# ========================================== # SERVER / COMMUNITY ABUSE # ==========================================
server_abuse: name: 'Server / Community Abuse'
reasons:
harassment_disruption: name: 'Harassment / Severe Disruption' duration: name: '14 days' days: 14
malicious_griefing: name: 'Malicious Griefing' duration: name: '14 days' days: 14
server_crashing: name: 'Attempting to Crash the Server' duration: name: '60 days' days: 60
lag_machine: name: 'Lag Machine' duration: name: '30 days' days: 30
ddos_threats: name: 'DDoS / Server Attack Threats' duration: name: '60 days' days: 60
doxxing: name: 'Doxxing / Sharing Private Information' duration: name: '60 days' days: 60
malicious_links: name: 'Malicious Links / Files' duration: name: '30 days' days: 30
advertising: name: 'Unauthorized Advertising' duration: name: '7 days' days: 7
impersonation: name: 'Player Impersonation' duration: name: '7 days' days: 7
# ========================================== # CHAT / BEHAVIOUR # ==========================================
chat_behavior: name: 'Chat / Behaviour'
reasons:
severe_harassment: name: 'Severe Harassment' duration: name: '14 days' days: 14
hate_speech: name: 'Hate Speech' duration: name: '30 days' days: 30
threats: name: 'Threats' duration: name: '30 days' days: 30
spam: name: 'Severe Spam' duration: name: '3 days' days: 3
chat_flooding: name: 'Chat Flooding' duration: name: '3 days' days: 3
inappropriate_content: name: 'Inappropriate Content' duration: name: '7 days' days: 7
inappropriate_language: name: 'Excessive Inappropriate Language' duration: name: '3 days' days: 3
toxic_behavior: name: 'Severe Toxic Behaviour' duration: name: '7 days' days: 7
# ========================================== # OTHER # ==========================================
other: name: 'Other'
reasons:
exploiting_player: name: 'Exploiting Another Player' duration: name: '14 days' days: 14
intentionally_ruining_gameplay: name: 'Intentionally Ruining Gameplay' duration: name: '7 days' days: 7
evading_staff: name: 'Staff Evasion' duration: name: '7 days' days: 7
other: name: 'Other' duration: name: '30 days' days: 30
Update config loading to support the supplied
duration:format and every listed reason.Remove free-form duration parsing; only configured durations will be accepted.
Allow
/punish <player> <reason>when the reason has one configured duration, while retaining/punish <player> <reason> <configured-duration>for reasons with multiple options.Replace
config.ymlwith the complete configurable punishment list you provided.
Updated the plugin to use only the configured reasons and durations.
Changes:
Added all punishment reasons from your config.
Added all configured categories:
Cheating / Unfair Advantage
Exploits / Bugs
Economy / Trading
Staff / Account
Server / Community Abuse
Chat / Behaviour
Other
Added support for the singular config format:
duration:
name: '30 days'
days: 30
Removed free-form durations such as
30m,2h, and60d./punish <player> <reason>now automatically uses that reason’s configured duration.Configured duration keys are still supported for reasons with multiple duration options.
Updated the command usage in
plugin.yml.
Example:
/punish Steve xray_esp
Uses the configured 30 days duration automatically.
/punish Steve server_crashing
Uses the configured 60 days duration automatically.
The punishment GUI will then appear with the configured reason and duration before the staff member confirms it. Use /punish reload after changing config.yml.
For allowed players could I just add like 908a579d-398d-4cdf-8898-128811c54bbf: JimmyTheVillager 64bc60ba-7704-42f1-9685-99a82bf82201: SneakyyYT
The generation was stopped before any content could be produced.
package com.kodari.punish;
import org.bukkit.command.PluginCommand;
import org.bukkit.event.HandlerList;
import org.bukkit.plugin.java.JavaPlugin;
public final class PunishPlugin extends JavaPlugin {
private PunishmentConfig punishmentConfig;
private PunishmentManager punishmentManager;
private PunishCommand punishCommand;
private PunishmentGui punishmentGui;
private UnpunishCommand unpunishCommand;
@Override
public void onEnable() {
saveDefaultConfig();
punishmentConfig = new PunishmentConfig(this);
punishmentConfig.reload(getConfig());
punishmentManager = new PunishmentManager(this, punishmentConfig);
punishCommand = new PunishCommand(this);
punishmentGui = new PunishmentGui(this);
PluginCommand punishCommand = getCommand("punish");
if (punishCommand != null) {
punishCommand.setExecutor(this.punishCommand);
punishCommand.setTabCompleter(this.punishCommand);
}
getServer().getPluginManager().registerEvents(new PunishmentGuiListener(this.punishCommand), this);
unpunishCommand = new UnpunishCommand(this);
PluginCommand unpunish = getCommand("unpunish");
if (unpunish != null) {
unpunish.setExecutor(unpunishCommand);
unpunish.setTabCompleter(unpunishCommand);
}
}
public void reloadPluginConfiguration() {
reloadConfig();
punishmentConfig.reload(getConfig());
}
public PunishmentConfig getPunishmentConfig() {
return punishmentConfig;
}
public PunishmentManager getPunishmentManager() {
return punishmentManager;
}
public PunishmentGui getPunishmentGui() {
return punishmentGui;
}
}