notflexxy._84610

Do not punish on the first violation. Punishment must execute only when the player reaches the configurable violation threshold (default: 3), and everything related to violations must remain configurable in config.yml.

Whenever a player commits a violation, send a configurable alert message to all online OPs. The alert format must be editable in config.yml.

Add a new mention system using a separate fully configurable file called mention.yml.

Support player mention using @{player} (example: @LUCIFER_XD). This mention does not require permission. The mentioned player must receive a configurable title and custom sound. The mention text in chat must appear bold and colored using the default format &b&l@{player}. Only the mention part should be colored, not the whole message.

Support LuckPerms group mention using @{group} (example: @admin). This requires permission pmcchatmention.@groups. If the sender does not have permission, the message must send normally with no color and no actions. All players who have that LuckPerms group must receive the title and sound. Each group must have its own configurable color in mention.yml with default examples: admin: &a@admin headadmin: &2&l@headadmin CEO: &9&l@CEO owner: &b&l@owner.

Support @everyone mention which requires permission pmcchatmention.@everyone. If the sender don't have permission, the message must send normally with no actions. if sender has permission then All online players must receive the title and sound. Default format is &a&l@Everyone.

Add a mention cooldown system for player after mention he need to wait default 10 seconds to menstion again, configurable in mention.yml. If a player tries to mention during cooldown, the message must not be sent and a configurable error message must be shown. Add bypass permission pmcchat.mention.bypass to bypass the cooldown. Operators must still require proper permissions to bypass cooldown and use group or everyone mentions.

Only color the mention text, not the full chat message. Only the targeted players should receive the title. Titles, sounds, colors, cooldown, and messages must be fully configurable in mention.yml. Do not add any other mention types beyond the ones specified.

Change the plugin version to 3.0

Kodari AI
KodariMar 1 at 6:47 pm 26,461 (v2)

Iโ€™ll analyze the project structure and add a mention system with all the requested features.

Iโ€™ll add a comprehensive mention system and fix the violation system to only punish at thresholds.

Now Iโ€™ll implement the complete mention system and fix the violation handling:

Now Iโ€™ll create the mention system files:

Plugin updated with complete mention system including player mentions, LuckPerms group mentions, @everyone mentions, cooldown system with bypass permissions, and configurable titles/sounds/colors in mention.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
18 1,535
src/main/java/com/pmcchat/PMCChatManager.java
package com.pmcchat;

import com.pmcchat.command.ReloadCommand;
import com.pmcchat.listener.AnvilListener;
import com.pmcchat.listener.BookListener;
import com.pmcchat.listener.ChatListener;
import com.pmcchat.listener.CommandListener;
import com.pmcchat.listener.SignListener;
import com.pmcchat.manager.AlertManager;
import com.pmcchat.manager.ConfigManager;
import com.pmcchat.manager.CooldownManager;
import com.pmcchat.manager.FilterManager;
import com.pmcchat.manager.MentionManager;
import com.pmcchat.manager.ViolationManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PMCChatManager extends JavaPlugin {
    
    private ConfigManager configManager;
    private FilterManager filterManager;
    private ViolationManager violationManager;
    private CooldownManager cooldownManager;
    private AlertManager alertManager;
    private MentionManager mentionManager;
    
    @Override
    public void onEnable() {
        this.saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.filterManager = new FilterManager(this);
        this.violationManager = new ViolationManager(this);
        this.cooldownManager = new CooldownManager(this);
        this.alertManager = new AlertManager(this);
        this.mentionManager = new MentionManager(this);
        
        this.configManager.loadConfig();
        
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CommandListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SignListener(this), this);
        Bukkit.getPluginManager().registerEvents(new BookListener(this), this);
        Bukkit.getPluginManager().registerEvents(new AnvilListener(this), this);
        
        this.getCommand("pmcchat").setExecutor(new ReloadCommand(this));
        
        this.getLogger().info("PMC-CHAT-MANAGER enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        this.cooldownManager.clearAll();
        this.violationManager.clearAll();
        this.mentionManager.clearCooldowns();
        this.getLogger().info("PMC-CHAT-MANAGER disabled successfully!");
    }
}