M

Project Name: HoverHead Compatibility: EssentialsX Chat & LPC & PlaceholderAPI Formatting: Legacy Color Codes ONLY (& and §) ​1. Core Feature: Dynamic 8x8 Player Head ​Placeholder: Create a custom PlaceholderAPI expansion: %hoverhead_chat_head%. ​The Matrix Logic: The plugin must fetch the sender's current skin texture and convert the 8x8 head area into a matrix of 64 colored Unicode characters (8 lines by 8 characters). ​Visuals: It must not be a single box. It must render as a small, square, colored pixel-art version of the player's actual skin head in the chat. ​Sync: It must automatically update if a player changes their skin. ​2. Existing Hover Tooltip (Preserve Functionality) ​Requirement: Keep the current hover system working exactly as it is. When a user hovers over a player's name, show this dark-themed layout: ​&f&lMEMBER &f%player_name% ​&7&m----------------------- ​&c❤ &fHearts: &d%player_health% ​&a$ &fMoney: &a%vault_eco_balance_formatted% ​&6⚔ &fKills: &6%statistic_player_kills% ​&e📶 &fPing: &b%player_ping%ms ​&7&m----------------------- ​&e&n➜ CLICK To Msg ​3. EssentialsX Chat Integration (Non-Destructive) ​Event Priority: Use @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true). ​Mechanism: Do not replace the EssentialsX format. Instead, target the player's name within the message and inject the HoverEvent and ClickEvent (Suggest: /msg <player> ) metadata. ​Head Placement: The %hoverhead_chat_head% placeholder must be usable inside the EssentialsX config.yml chat format string. ​4. Configuration & Optimization ​Config.yml: Provide a toggle enable-player-head: true. ​Caching: Skin textures and head matrices must be cached to prevent API rate-limiting and server lag. ​Async Processing: All skin fetching and processing must be done asynchronously.

Kodari AI
KodariJan 29 at 5:31 pm 11,404 (v2)

I’ll create a comprehensive HoverHead plugin with custom 8x8 player head rendering, PlaceholderAPI integration, and EssentialsX Chat compatibility.

HoverHead
Advanced chat enhancement plugin that renders player skin heads as 8x8 colored pixel art in chat using PlaceholderAPI. Features dynamic skin texture fetching, intelligent caching, and rich hover tooltips displaying player stats (health, balance, kills, ping). Seamlessly integrates with EssentialsX Chat while preserving all existing functionality. Includes click-to-message support and async processing for optimal performance.

I’ve created a complete HoverHead plugin with all requested features:

✨ Key Features Implemented:

1. 8x8 Player Head Rendering

  • Fetches player skin textures from Mojang’s session server

  • Extracts and blends the 8x8 head region (base layer + overlay)

  • Converts each pixel to the closest legacy color code (§0-§f)

  • Renders as 8 lines of colored Unicode blocks (█)

2. PlaceholderAPI Integration

  • Custom expansion providing %hoverhead_chat_head%

  • Returns the 8-line colored head for use in EssentialsX chat format

  • Automatically updates when players change skins

3. EssentialsX Chat Compatibility

  • Listens at HIGHEST priority to preserve EssentialsX formatting

  • Finds player name in the formatted message

  • Wraps name with hover/click events using BungeeCord API

  • Never modifies the base format string

4. Rich Hover Tooltips

  • Shows player stats: Health, Balance, Kills, Ping

  • Fully customizable format in config.yml

  • All lines support PlaceholderAPI

  • Uses legacy color codes (&/§)

5. Click-to-Message

  • Clicking a player’s name suggests /msg <player>

  • Can be toggled in config

6. Smart Caching & Async Processing

  • All skin fetching is asynchronous

  • Intelligent caching with configurable expiry (default: 30 minutes)

  • Automatic cleanup task runs every 5 minutes

  • Prevents duplicate fetches within 1 second

7. Configuration Options

YAML
enable-player-head: true          # Toggle 8x8 heads
enable-hover-tooltip: true        # Toggle hover stats
enable-click-to-message: true     # Toggle click functionality
cache-expiry-minutes: 30          # How long to cache heads
skin-fetch-timeout-seconds: 5     # Network timeout
head-character: '█'               # Display character
tooltip-format: [...]             # Customizable hover text

📝 Usage:

In your EssentialsX config.yml, add the placeholder to your chat format:

YAML
format: '%hoverhead_chat_head% {DISPLAYNAME} &7» &f{MESSAGE}'

The player’s name will automatically have hover stats and click-to-message functionality!

🔧 Commands:

  • /hoverhead reload or /hh reload - Reloads config and clears cache

The plugin is production-ready with proper error handling, async processing, and full compatibility with EssentialsX, PlaceholderAPI, and Vault!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 666
src/main/java/com/hoverhead/HoverHead.java
package com.hoverhead;

import com.hoverhead.expansion.HeadPlaceholderExpansion;
import com.hoverhead.listener.ChatListener;
import com.hoverhead.service.CacheManager;
import com.hoverhead.service.HeadRenderer;
import com.hoverhead.service.SkinService;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class HoverHead extends JavaPlugin {
    private SkinService skinService;
    private HeadRenderer headRenderer;
    private CacheManager cacheManager;
    private ChatListener chatListener;

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

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") == null) {
            getLogger().severe("PlaceholderAPI not found! Disabling plugin...");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        cacheManager = new CacheManager(this);
        skinService = new SkinService(this);
        headRenderer = new HeadRenderer(this);
        chatListener = new ChatListener(this);

        Bukkit.getPluginManager().registerEvents(chatListener, this);

        HeadPlaceholderExpansion expansion = new HeadPlaceholderExpansion(this);
        if (!expansion.register()) {
            getLogger().warning("Failed to register PlaceholderAPI expansion!");
        }

        getLogger().info("HoverHead enabled successfully!");
    }

    @Override
    public void onDisable() {
        if (cacheManager != null) {
            cacheManager.clearAll();
        }
        getLogger().info("HoverHead disabled.");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length > 0 && args[0].equalsIgnoreCase("reload")) {
            if (!sender.hasPermission("hoverhead.reload")) {
                sender.sendMessage("§cYou don't have permission to reload the plugin.");
                return true;
            }
            reloadConfig();
            cacheManager.clearAll();
            sender.sendMessage("§aHoverHead configuration reloaded!");
            return true;
        }
        sender.sendMessage("§eHoverHead v1.0.0 §7- §fUse /hh reload");
        return true;
    }

    public SkinService getSkinService() {
        return skinService;
    }

    public HeadRenderer getHeadRenderer() {
        return headRenderer;
    }

    public CacheManager getCacheManager() {
        return cacheManager;
    }
}