pankajpmc

Fix not showing Hover text. Don't add any chat format use Default luckperms chat Fromat

Kodari AI
KodariMay 9 at 8:49 am 14,095 (v2)

Iโ€™ll read the relevant files to identify the hover text issue.

I can see the issue. The ChatHoverManager is using its own chat-format which overrides LuckPermsโ€™ chat format. The solution is to use the eventโ€™s format (which LuckPerms already sets) instead of a custom format.

Let me fix this:

Fixed! The hover text now works with LuckPermsโ€™ default chat format.

Changes made:

  1. ChatListener - Now passes the eventโ€™s format (set by LuckPerms) to the hover manager

  2. ChatHoverManager - Uses LuckPermsโ€™ chat format instead of a custom format

  3. chathover.yml - Updated documentation to clarify that LuckPerms handles chat formatting

The plugin now:

  • Uses whatever chat format LuckPerms sets (with prefixes, suffixes, colors, etc.)

  • Adds hover text and click actions on top of that format

  • Preserves all LuckPerms chat formatting

The hover text and click events will now appear when hovering over chat messages, while the actual chat format comes from LuckPerms.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
18 1,365
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.ChatHoverManager;
import com.pmcchat.manager.ConfigManager;
import com.pmcchat.manager.CooldownManager;
import com.pmcchat.manager.FilterManager;
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 ChatHoverManager chatHoverManager;
    
    @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.chatHoverManager = new ChatHoverManager(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.getLogger().info("PMC-CHAT-MANAGER disabled successfully!");
    }
}