youwixo
📎 1 file 2,190 chars
📄
pasted-code-1778504647836.txt
txt 75 lines
▶
Create a plugin for me called “Punishment System”.
I want it to use permissions, and I want all permissions to be configurable inside a separate permissions file so I can assign them to ranks easily.

When a player with permission uses `/punish `, a INVENTORY GUI should open with these options:

* Ban
* Mute
* Kick

When clicking any of them, another INVENTORY GUI should open showing multiple punishment reasons.

I also want a separate file for reasons where I can:

* Add new reasons
* Remove reasons
* Edit reasons

Add a few example reasons by default — I’ll edit them myself later.

There should also be a “Custom” option so staff can type their own punishment reason manually.

After selecting the reason, the plugin should ask for the punishment duration.
Just like reasons, durations should also be editable inside a separate config file.

Add some default durations, but also include a “Custom” option so staff can enter any custom duration manually.

After that, show a final confirmation INVENTORY GUI with:

* Confirm
* Cancel

Under the confirm button, add a description saying:

* Shift + Left Click → makes the punishment Public
* Shift + Right Click → makes the punishment Silent

If it is Public:
Broadcast a beautiful and professional message across all servers saying that:

* The player was punished
* By staff member “...”
* Punishment ID “...”
* Duration “...”

Make the message design very clean, modern, and stylish.

If it is Silent:
Only players with the permission `punish.view.silent` should see the punishment message.

The silent message should be exactly the same as the public one, but with “(Silent)” added next to it.

The whole plugin theme should use an Aqua style/theme.

Also add:

* Full config.yml
* messages.yml
* permissions.yml

And add direct commands too, for example:

* `/ban`
* `/mute`
* `/kick`

Public commands should broadcast globally, while silent versions like:

* `/slban`
* `/slmute`
* `/slkick`

should only be visible to players with the correct permission.

I want the entire plugin to look very clean, modern, professional, and well-designed.
Kodari AI
KodariMay 11 at 1:07 pm 20,041 (v2)

I’ll build this comprehensive Punishment System plugin. Let me plan the architecture first:

  • Core classes: Main plugin, Config managers (config, messages, permissions, reasons, durations), PunishmentManager

  • GUI flow: PunishGUI (Ban/Mute/Kick) → ReasonsGUI → DurationGUI → ConfirmGUI

  • Commands: /punish, /ban, /mute, /kick, /slban, /slmute, /slkick

  • Data: Punishment records with IDs, stored persistently

PunishmentSystem
A comprehensive staff punishment plugin featuring a sleek aqua-themed GUI workflow for Ban, Mute, and Kick actions. Supports configurable reasons and durations, custom input via chat, public/silent punishment broadcasts, unique punishment IDs, and direct commands (/ban, /mute, /kick, /slban, /slmute, /slkick). All permissions are defined in a dedicated permissions.yml for easy rank integration.

Here’s a summary of everything built:

GUI Flow: /punish <player> → PunishGUI (Ban/Mute/Kick) → ReasonsGUI (configurable reasons + Custom chat input) → DurationGUI (configurable durations + Custom chat input) → ConfirmGUI (Shift+Left = Public, Shift+Right = Silent)

Broadcast: Clean aqua-themed multi-line broadcast with staff name, target, type, reason, duration, and unique 8-char punishment ID. Silent punishments are identical but tagged [Silent] and only visible to players with punish.view.silent.

Direct Commands: /ban, /mute, /kick (public) and /slban, /slmute, /slkick (silent) — all inline with <player> <duration> <reason> syntax.

Config Files:

  • config.yml — prefix, server name

  • messages.yml — all user-facing messages

  • permissions.yml — all permission nodes, easily mapped to rank groups

  • reasons.yml — per-type reason lists (ban/mute/kick + default fallback)

  • durations.yml — flat list of duration options

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
34 1,675
src/main/java/com/punishmentsystem/PunishmentSystem.java
package com.punishmentsystem;

import com.punishmentsystem.commands.*;
import com.punishmentsystem.config.*;
import com.punishmentsystem.inventory.gui.GUIListener;
import com.punishmentsystem.inventory.gui.GUIManager;
import com.punishmentsystem.listeners.ChatInputListener;
import com.punishmentsystem.managers.PunishmentManager;
import org.bukkit.plugin.java.JavaPlugin;

public class PunishmentSystem extends JavaPlugin {

    private GUIManager guiManager;
    private ConfigManager configManager;
    private MessagesManager messagesManager;
    private PermissionsManager permissionsManager;
    private ReasonsManager reasonsManager;
    private DurationsManager durationsManager;
    private PunishmentManager punishmentManager;
    private ChatInputListener chatInputListener;

    @Override
    public void onEnable() {
        saveDefaultConfigs();

        this.configManager = new ConfigManager(this);
        this.messagesManager = new MessagesManager(this);
        this.permissionsManager = new PermissionsManager(this);
        this.reasonsManager = new ReasonsManager(this);
        this.durationsManager = new DurationsManager(this);
        this.punishmentManager = new PunishmentManager(this);
        this.guiManager = new GUIManager();
        this.chatInputListener = new ChatInputListener(this);

        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
        getServer().getPluginManager().registerEvents(chatInputListener, this);

        registerCommands();

        getLogger().info("PunishmentSystem enabled successfully.");
    }

    @Override
    public void onDisable() {
        getLogger().info("PunishmentSystem disabled.");
    }

    private void saveDefaultConfigs() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("permissions.yml", false);
        saveResource("reasons.yml", false);
        saveResource("durations.yml", false);
    }

    private void registerCommands() {
        getCommand("punish").setExecutor(new PunishCommand(this));
        getCommand("ban").setExecutor(new BanCommand(this));
        getCommand("mute").setExecutor(new MuteCommand(this));
        getCommand("kick").setExecutor(new KickCommand(this));
        getCommand("slban").setExecutor(new SilentBanCommand(this));
        getCommand("slmute").setExecutor(new SilentMuteCommand(this));
        getCommand("slkick").setExecutor(new SilentKickCommand(this));
    }

    public GUIManager getGuiManager() { return guiManager; }
    public ConfigManager getCfg() { return configManager; }
    public MessagesManager getMessages() { return messagesManager; }
    public PermissionsManager getPerms() { return permissionsManager; }
    public ReasonsManager getReasons() { return reasonsManager; }
    public DurationsManager getDurations() { return durationsManager; }
    public PunishmentManager getPunishmentManager() { return punishmentManager; }
    public ChatInputListener getChatInputListener() { return chatInputListener; }
}