aeynz_

make me a punish ban system

Kodari AI
KodariJun 12 at 3:14 am 19

I’ll create a comprehensive punishment and ban management system.

PunishSystem
A complete punishment management plugin featuring temporary and permanent bans, mutes, kicks, and warnings. Includes customizable punishment messages, duration formatting, punishment history tracking with JSON storage, automatic ban enforcement on join, mute enforcement in chat, and full admin commands for managing player infractions. Supports offline player punishment and detailed punishment records.

I’ve created PunishSystem — a complete punishment and ban management plugin with:

Features:

  • Permanent & temporary bans

  • Permanent & temporary mutes

  • Kick & warn systems

  • Full punishment history tracking

  • JSON-based storage

  • Offline player punishment support

  • Customizable messages in config

  • Duration parsing (1d, 2h, 30m, etc.)

  • Auto-enforcement on join/chat

  • Staff broadcast notifications

Commands:

  • /ban <player> <reason> — Permanent ban

  • /tempban <player> <duration> <reason> — Temporary ban

  • /unban <player> — Remove ban

  • /kick <player> <reason> — Kick player

  • /mute <player> <reason> — Permanent mute

  • /tempmute <player> <duration> <reason> — Temporary mute

  • /unmute <player> — Remove mute

  • /warn <player> <reason> — Issue warning

  • /punishhistory <player> — View all punishments

Usage examples:

  • /tempban Steve 7d Hacking — Ban for 7 days

  • /tempmute Alex 2h Spamming — Mute for 2 hours

  • /punishhistory Notch — View punishment history

The system automatically enforces bans on join and mutes in chat, with expired punishment detection built-in.

aeynz_

can i make like it show the guy who got ban in discord punish logs webhook

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
20 1,251
src/main/java/com/punishsystem/PunishSystem.java
package com.punishsystem;

import com.punishsystem.command.*;
import com.punishsystem.listener.PlayerChatListener;
import com.punishsystem.listener.PlayerJoinListener;
import com.punishsystem.manager.PunishmentManager;
import com.punishsystem.storage.StorageManager;
import lombok.Getter;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PunishSystem extends JavaPlugin {

    private StorageManager storageManager;
    private PunishmentManager punishmentManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.storageManager = new StorageManager(this);
        this.punishmentManager = new PunishmentManager(this);
        
        registerCommands();
        registerListeners();
        
        getLogger().info("PunishSystem has been enabled!");
    }

    @Override
    public void onDisable() {
        if (storageManager != null) {
            storageManager.saveAll();
        }
        getLogger().info("PunishSystem has been disabled!");
    }

    private void registerCommands() {
        getCommand("ban").setExecutor(new BanCommand(this));
        getCommand("tempban").setExecutor(new TempBanCommand(this));
        getCommand("unban").setExecutor(new UnbanCommand(this));
        getCommand("kick").setExecutor(new KickCommand(this));
        getCommand("mute").setExecutor(new MuteCommand(this));
        getCommand("tempmute").setExecutor(new TempMuteCommand(this));
        getCommand("unmute").setExecutor(new UnmuteCommand(this));
        getCommand("warn").setExecutor(new WarnCommand(this));
        getCommand("punishhistory").setExecutor(new PunishHistoryCommand(this));
    }

    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerChatListener(this), this);
    }

    public String getMessage(String path) {
        String message = getConfig().getString("messages." + path, "&cMessage not found: " + path);
        return ChatColor.translateAlternateColorCodes('&', message);
    }

    public String getPrefix() {
        return getMessage("prefix");
    }
}