mpeyboun_83492

Make a plugin name UxNameGradient this plugin will change player names to gradient with different RGB style. INVENTORY GUI select style and placholder to show name. author theandev. Version 1.20+ customize everything like sounds style etc.

Kodari AI
KodariMar 19 at 12:48 pm 26,140 (v2)
UxNameGradient
A Minecraft plugin (1.20+) that allows players to apply beautiful RGB gradient styles to their names. Features a fully interactive GUI for browsing and selecting gradient styles, PlaceholderAPI integration to expose gradient names, per-player style persistence, admin reload command, and full config customization including styles, colors, sounds, GUI layout, and messages. Built with MiniMessage for rich gradient rendering.

Plan:

  • Build full inventory GUI framework + StyleSelectorGUI with all configured styles rendered live

  • GradientManager handles style loading, player data persistence (playerdata.yml), display name + tab list name application via Adventure API

  • GradientExpansion for PlaceholderAPI (%uxnamegradient_name%, %uxnamegradient_style%)

  • /gradient command with open/reload/reset/style subcommands + tab completion

  • All sounds, messages, styles, GUI fully configurable in config.yml

Here is a summary of what was built:

  • 13 files across a clean package structure (manager, data, command, listener, placeholder, inventory/**, util)

  • StyleSelectorGUI dynamically renders every configured style with gradient-previewed item names, glow on the currently selected style, configurable border/fill/reset/close buttons

  • GradientManager loads styles from config.yml at startup/reload, persists per-player selections to playerdata.yml, and applies displayName + playerListName via Adventure API on join/style change

  • 4 PlaceholderAPI placeholders — %uxnamegradient_name% (legacy colored), %uxnamegradient_style% (id), %uxnamegradient_style_display% (MiniMessage display), %uxnamegradient_has_gradient% (boolean)

  • /gradient opens GUI, /gradient style <id> sets directly, /gradient reset clears, /gradient reload reloads all config + reapplies all online players — all with tab completion, sound feedback, and permission checks (uxnamegradient.use / uxnamegradient.admin)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
19 1,258
src/main/java/com/theandev/uxnamegradient/UxNameGradient.java
package com.theandev.uxnamegradient;

import com.theandev.uxnamegradient.command.GradientCommand;
import com.theandev.uxnamegradient.inventory.gui.GUIListener;
import com.theandev.uxnamegradient.inventory.gui.GUIManager;
import com.theandev.uxnamegradient.listener.PlayerListener;
import com.theandev.uxnamegradient.manager.GradientManager;
import com.theandev.uxnamegradient.placeholder.GradientExpansion;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class UxNameGradient extends JavaPlugin {

    private GUIManager guiManager;
    private GradientManager gradientManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.gradientManager = new GradientManager(this);
        this.guiManager = new GUIManager();

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);

        GradientCommand gradientCommand = new GradientCommand(this);
        getCommand("gradient").setExecutor(gradientCommand);
        getCommand("gradient").setTabCompleter(gradientCommand);

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new GradientExpansion(this).register();
            getLogger().info("PlaceholderAPI hooked successfully.");
        }

        gradientManager.loadAllPlayerData();
        getLogger().info("UxNameGradient enabled. " + gradientManager.getStyles().size() + " styles loaded.");
    }

    @Override
    public void onDisable() {
        gradientManager.saveAllPlayerData();
        getLogger().info("UxNameGradient disabled. Player data saved.");
    }

    public void reload() {
        reloadConfig();
        gradientManager.reload();
    }
}