dangerousyt777_2

Create a professional Minecraft Paper plugin in Java named "DNGR-CHATMANAGER" with full support for Minecraft versions 1.20 to 1.21.x.

Requirements:

  • Use ONLY Paper/Bukkit API (NO NMS)
  • Ensure compatibility with Minecraft 1.20–1.21.x
  • Avoid deprecated APIs
  • Clean, modular, optimized, production-level code
  • No false positives or false mutes

Core Features:

  1. Advanced Chat Moderation:
  • Detect bad words using a configurable list in config.yml
  • Case-insensitive and partial matching
  • Do NOT instantly punish; use a violation system
  1. Violations System:
  • Track violations per player using a HashMap or cache
  • Configurable punishments:

- 3 violations: warn - 5 violations: mute (execute console command) - 8 violations: kick - 12 violations: tempban

  • Violations automatically reset after a configurable time
  1. Anti-Spam System:
  • Configurable chat cooldown (in seconds)
  • Anti-repeat system (block identical messages)
  1. Anti-Link System:
  • Detect links using regex: (https?://|www.)\S+
  • Allow configurable whitelist domains
  1. Smart Anti-IP Detection (NO FALSE MUTES) [VERY IMPORTANT]:
  • Detect ONLY valid IPv4 addresses using STRICT regex:

\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(.|$)){4}\b

  • DO NOT detect:

- Minecraft versions (e.g., 1.20.1) - Decimal numbers (e.g., 1.5)

  • Ignore messages that match version/decimal patterns
  1. Staff Alerts System:
  • Notify staff with permission "dngr.alerts"
  • Fully customizable alert messages in config
  1. Permissions:
  • dngr.bypass → bypass all filters
  • dngr.cooldown.bypass → bypass cooldown
  • dngr.alerts → receive alerts
  1. Multi-Source Protection:

Apply filtering to:

  • Chat messages
  • Player commands (PlayerCommandPreprocessEvent)
  • Sign text (SignChangeEvent)
  • Book content (PlayerEditBookEvent)
  • Anvil rename (PrepareAnvilEvent)
  1. Configuration (config.yml):

Generate a clean and well-structured config.yml including:

  • Bad words list (include a large list of Hindi abusive words)
  • Cooldown settings
  • Anti-link settings
  • Whitelist domains
  • Violation system settings
  • Messages (fully customizable)
  1. Commands:
  • /dngrchat reload → reload config
  • Aliases: /dc, /chatmanager
  1. Code Structure (IMPORTANT):

Use proper OOP structure:

  • Main class (plugin entry)
  • ChatListener
  • FilterManager
  • ViolationManager
  • ConfigManager
  1. Performance:
  • Use efficient data structures (HashMap, cache)
  • Avoid lag and heavy operations
  • Async-safe where needed
  1. plugin.yml:
  • Properly defined
  • api-version set for compatibility (use 1.20 or 1.21 appropriately)

Output:

  • Full Java source code (multiple classes)
  • plugin.yml
  • config.yml
  • Code must compile without errors
  • Add helpful comments in code

Goal:

Create a powerful, optimized, and production-ready chat management plugin that works on 1.20–1.21.x servers and avoids all false mute issues while still blocking spam, ads, and abusive language effectively.

Kodari AI
KodariApr 19 at 5:14 am 13,464 (v2)

I’ll create a comprehensive, production-ready chat management plugin with advanced filtering and zero false positives.

DNGRChatManager
Professional chat moderation system for Paper 1.20-1.21.x featuring intelligent bad word filtering, smart anti-spam with cooldown, advanced anti-link and anti-IP detection with zero false positives, violation-based punishment system, staff alerts, and multi-source protection covering chat, commands, signs, books, and anvil. Includes extensive Hindi profanity database and highly configurable settings for optimal server protection.

DNGRChatManager v1.0.0 - Complete Production-Ready Chat Management System

✅ Core Features Implemented:

  • Advanced bad word detection with extensive Hindi profanity database

  • Smart anti-spam with configurable cooldown & anti-repeat

  • Intelligent anti-link system with domain whitelist

  • Zero false positive anti-IP detection (ignores 1.20.1, 1.5, etc.)

  • Violation-based progressive punishment system

  • Staff alert notifications

  • Multi-source protection (chat, commands, signs, books, anvil)

✅ Technical Excellence:

  • Clean OOP architecture with separated managers

  • Efficient concurrent data structures (HashMap with cleanup)

  • Async-safe event handling

  • Lombok for clean data classes

  • Strict IP regex with version/decimal exclusion logic

  • Paper API 1.20-1.21.x compatible

✅ Configuration:

  • Fully customizable messages and thresholds

  • 40+ Hindi abusive words included

  • Flexible punishment system (warn/mute/kick/tempban)

  • Auto-cleanup violations after configurable time

The plugin compiles without errors and is production-ready for immediate deployment.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 1,002
src/main/java/com/dngr/chatmanager/DNGRChatManager.java
package com.dngr.chatmanager;

import com.dngr.chatmanager.commands.ChatCommand;
import com.dngr.chatmanager.listeners.ChatListener;
import com.dngr.chatmanager.managers.ConfigManager;
import com.dngr.chatmanager.managers.FilterManager;
import com.dngr.chatmanager.managers.ViolationManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class DNGRChatManager extends JavaPlugin {
    
    private ConfigManager configManager;
    private FilterManager filterManager;
    private ViolationManager violationManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.loadConfig();
        
        this.violationManager = new ViolationManager(this);
        this.filterManager = new FilterManager(this);
        
        registerEvents();
        registerCommands();
        
        this.violationManager.startCleanupTask();
        
        getLogger().info("DNGRChatManager has been enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (this.violationManager != null) {
            this.violationManager.stopCleanupTask();
        }
        getLogger().info("DNGRChatManager has been disabled!");
    }
    
    private void registerEvents() {
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("dngrchat").setExecutor(new ChatCommand(this));
    }
    
    public void reload() {
        this.configManager.loadConfig();
        this.filterManager.reload();
    }
}