Emilis Plausinis

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:

  1. Save the player's UUID, username, reason, duration, staff member, timestamp and punishment ID.
  2. 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.
  3. Ban the player with the selected reason and duration.
  4. Disconnect the player if they are online.
  5. Log the punishment to the console.
  6. 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
Kodari AI
KodariSep 12 at 8:42 pm 2
Punish
Staff punishment management plugin with a GUI-based system for selecting reasons and durations. Features configurable punishment reasons, durations, and wipe settings in config.yml. Includes confirmation workflow, automatic player data wiping, banning, disconnection, and logging. Provides punishment history/log system and permission-based access control.
  1. Create the Gradle Paper plugin scaffold and plugin metadata.

  2. Add configurable punishment definitions, messages, wipe settings, and appeal text.

  3. Implement punishment persistence, history, wiping, banning, disconnects, and logging.

  4. Add the staff command, reload/history subcommands, and confirmation-based GUI.

Implemented the new Punish Paper plugin with:

  • /punish <player> staff GUI

  • Configurable punishment categories, reasons, and durations

  • Required confirmation step before punishment

  • Persistent punishment history in punishments.yml

  • /punish history <player>

  • /punish reload

  • Configurable permissions:

    • punish.use

    • punish.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

Emilis Plausinis

Can you make it that it shows /punish username and like xray, esp , bartionte or whatever

Kodari AI
KodariSep 12 at 8:50 pm 1

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:

Plain Text
/punish username

The reason names and durations still come from config.yml, so they remain fully configurable.

Emilis Plausinis

Remove the like gui it shows for /punish and just it shows like /punish [username] [Reason] [duration into mins hours days]

Kodari AI
KodariSep 12 at 8:56 pm 2
  1. Replace the GUI flow with /punish <player> <reason> <duration>.

  2. Support configurable reason keys/names plus durations such as 30m, 2h, 60d, and permanent.

  3. Preserve the safety confirmation using /punish confirm.

  4. Remove GUI registration and update usage/tab completion.

Removed the punishment GUI. Staff now use:

Plain Text
/punish <username> <reason> <duration>

Examples:

Plain Text
/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:

Plain Text
30m
2h
60d
1 week
permanent

Reasons can use their configurable key, such as:

Plain Text
xray_esp
baritone_automation
killaura_combat
autoclicker_macros
duplication
ban_evasion

For safety, the command displays the pending punishment first. Apply it with:

Plain Text
/punish confirm

The old GUI files and GUI registration were removed.

Emilis Plausinis

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]

Kodari AI
KodariSep 12 at 8:59 pm 3
  1. Add a confirmation GUI after /punish <username> <reason> <duration>, with green confirm and red decline panels.

  2. Add /unpunish <username> with permission checks and configurable messages.

Implemented.

Punishment confirmation GUI

After entering:

Plain Text
/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:

Plain Text
/unpunish <username>

Permission:

Plain Text
punish.unpunish

It removes the player’s active ban and logs who removed it. Messages and GUI text are configurable in config.yml.

Emilis Plausinis

The compilation failed with this error:

code
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.

Kodari AI
KodariSep 12 at 9:00 pm 1

Fixed the compilation errors by using the typed Bukkit ban APIs:

  • BanList<String> instead of raw BanList

  • BanEntry<String> when iterating ban entries

  • entry.getTarget() to retrieve the banned username

Updated:

Plain Text
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.

Emilis Plausinis

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

Kodari AI
KodariSep 13 at 2:49 pm 2
  1. Update config loading to support the supplied duration: format and every listed reason.

  2. Remove free-form duration parsing; only configured durations will be accepted.

  3. Allow /punish <player> <reason> when the reason has one configured duration, while retaining /punish <player> <reason> <configured-duration> for reasons with multiple options.

  4. Replace config.yml with 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:

YAML
duration:
  name: '30 days'
  days: 30
  • Removed free-form durations such as 30m, 2h, and 60d.

  • /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:

Plain Text
/punish Steve xray_esp

Uses the configured 30 days duration automatically.

Plain Text
/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.

Emilis Plausinis

For allowed players could I just add like 908a579d-398d-4cdf-8898-128811c54bbf: JimmyTheVillager 64bc60ba-7704-42f1-9685-99a82bf82201: SneakyyYT

Kodari AI
KodariSep 13 at 2:59 pm 1

The generation was stopped before any content could be produced.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
12 1,350
src/main/java/com/kodari/punish/PunishPlugin.java
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;
    }
}