lucifer36u43

badwords system is not working properly getting muted for not reason only detect if a message have correct bedword also execute different command if someone advertise/abuse on Sign board and item names

Kodari AI
KodariMar 24 at 4:43 pm 11,892 (v2)

Let me read all relevant files first.

Now I have a full picture. Here’s my plan:

  • Create BadWordManager with proper whole-word regex matching (no false positives), separate advertise/abuse detection, and console command execution

  • Create BadWordListener handling AsyncPlayerChatEvent, SignChangeEvent, and PrepareAnvilEvent

  • Expand ConfigManager with bad-word/advertise config sections

  • Update PMCPluginManager, config.yml, message.yml

Here’s what changed:

  • BadWordManager — uses whole-word regex boundaries ((?<![a-z0-9])word(?![a-z0-9])) so "grass" won’t trigger "ass", fully separate ABUSE vs ADVERTISE detection, and runs the correct punish commands (with {player} placeholder) via console

  • BadWordListener — catches chat (AsyncPlayerChatEvent), sign writing (SignChangeEvent), and anvil item renaming (PrepareAnvilEvent), each sending its own distinct warning message and triggering the matching punishment

  • ConfigManager — loads all bad-word config sections (words, commands, per-channel toggle)

  • config.yml — new bad-words section with abuse.words, advertise.words, separate punish-commands per type, and a built-in IP address regex pattern for advertise detection

  • message.yml — 6 new warning messages for each channel × type combination

  • Players with pmcpluginmanager.bypass permission are completely exempt from bad-word checks

lucifer36u43

update version to 2.0

Kodari AI
KodariMar 24 at 4:46 pm 3,928 (v2)

Version updated from 1.0 to 2.0 in plugin.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
12 591
src/main/java/com/lucifer/pmc/PMCPluginManager.java
package com.lucifer.pmc;

import com.lucifer.pmc.command.PMCCommand;
import com.lucifer.pmc.listener.BadWordListener;
import com.lucifer.pmc.listener.CommandBlockListener;
import com.lucifer.pmc.manager.BadWordManager;
import com.lucifer.pmc.manager.ConfigManager;
import com.lucifer.pmc.manager.MessageManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PMCPluginManager extends JavaPlugin {

    private ConfigManager configManager;
    private MessageManager messageManager;
    private BadWordManager badWordManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.messageManager = new MessageManager(this);
        this.badWordManager = new BadWordManager(this);

        this.configManager.loadConfig();
        this.messageManager.loadMessages();
        this.badWordManager.load();

        Bukkit.getPluginManager().registerEvents(new CommandBlockListener(this), this);
        Bukkit.getPluginManager().registerEvents(new BadWordListener(this), this);

        this.getCommand("pmcmanager").setExecutor(new PMCCommand(this));

        this.getLogger().info("PMC-PLUGIN-MANAGER v1.0 by LUCIFER_XD has been enabled!");
    }

    @Override
    public void onDisable() {
        this.getLogger().info("PMC-PLUGIN-MANAGER has been disabled!");
    }

    public void reload() {
        this.configManager.loadConfig();
        this.messageManager.loadMessages();
        this.badWordManager.load();
    }
}