s4mixer2

okay make me these two .yml files into 1 jar file i already have a config and a plugin file.

📎 2 files 1,760 chars
📄
config.yml
yml 40 lines
▶
# DonutChatHover By ShyamStudio

# Chat Format
# Placeholders:
# {message} - the chat message
# {name} - the player's name
# {displayname} - the player's display name / nickname
# {world} - the world name of the player's current world
# {prefix} - the player's prefix from LuckPerms
# {suffix} - the player's suffix from LuckPerms
# {username-color} - the player's or the group's username color meta
# {message-color} - the player's or the group's message color meta
#
# Note: Always use &r to reset color after the name to prevent color bleeding into message
chat-format: "{prefix}{name}&r: {message}"

# Group-specific formats (if needed)
group-formats:
# example: "{prefix}{name}&r: {message}"
# admin: "&c[ADMIN] {name}&r: {message}"

# Hover text when hovering over a player's name in chat
hover-text: |
  §7%player%
  §7------------
  §a$ §fMoney: §a%vault_eco_balance_formatted%
  §c🗡 §fKills: §c%kills%
  §e⌚ §fPlaytime: §e%playtime%
  §4☠ §fDeaths: §4%deaths%
  §7------------
  §7Click To Private Message!

# The command that will be executed when clicking on a player's name
# Use %player% as a placeholder for the player's name
click-command: "/w %player%"

# Messages
messages:
  reload-success: "&aDonutChatHover configuration reloaded successfully!"
  no-permission: "&cYou don't have permission to use this command!"
📄
plugin.yml
yml 14 lines
▶
name: DonutChatHover
version: '1.2'
main: og.shyamstudio.donutChatHover.DonutChatHover
api-version: '1.20'
depend: [LuckPerms]
softdepend:
  - Vault
  - PlaceholderAPI
commands:
  dchatHover:
    description: Reload the DonutChatHover configuration.
    usage: /dchathover reload
    permission: donutchathover.reload
    permission-message: You don't have permission to use this command.
Kodari AI
KodariJan 27 at 4:28 pm 5,332 (v2)

I’ll create a complete DonutChatHover plugin from those YAML files.

DonutChatHover
A chat enhancement plugin that adds interactive hover text and click actions to player names in chat. Features customizable chat formatting with LuckPerms integration, group-specific formats, PlaceholderAPI support for dynamic hover information, and click-to-message functionality. Includes comprehensive configuration options and in-game reload command.

Your DonutChatHover plugin is ready! Build it with ./gradlew build and find the JAR in build/libs/.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 283
src/main/java/og/shyamstudio/donutChatHover/DonutChatHover.java
package og.shyamstudio.donutChatHover;

import lombok.Getter;
import net.luckperms.api.LuckPerms;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public class DonutChatHover extends JavaPlugin {

    @Getter
    private static DonutChatHover instance;
    
    @Getter
    private LuckPerms luckPerms;
    
    @Getter
    private Economy economy;
    
    @Getter
    private boolean placeholderAPI;

    @Override
    public void onEnable() {
        instance = this;
        
        saveDefaultConfig();
        
        if (!setupLuckPerms()) {
            getLogger().severe("LuckPerms not found! Disabling plugin.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        
        setupVault();
        placeholderAPI = getServer().getPluginManager().getPlugin("PlaceholderAPI") != null;
        
        getServer().getPluginManager().registerEvents(new ChatListener(this), this);
        getCommand("dchatHover").setExecutor(new ReloadCommand(this));
        
        getLogger().info("DonutChatHover has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("DonutChatHover has been disabled!");
    }

    private boolean setupLuckPerms() {
        RegisteredServiceProvider<LuckPerms> provider = getServer().getServicesManager().getRegistration(LuckPerms.class);
        if (provider != null) {
            luckPerms = provider.getProvider();
        }
        return luckPerms != null;
    }

    private void setupVault() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp != null) {
            economy = rsp.getProvider();
        }
    }

    public void reloadConfiguration() {
        reloadConfig();
    }
}