bhanu.xd.
📎 1 file 5,333 chars
📄
pasted-code-1775892890666.txt
txt 407 lines
▶
**🔥 ULTRA ADVANCED PLUGIN GENERATION PROMPT (FINAL PRO VERSION) 🔥**
 
Create a **fully functional, ultra-optimized, next-generation Minecraft hologram plugin** with the following specifications:
  
# 🔹 Plugin Information
 
 
- **Name:** NyxBH
 
- **Java Version:** 21
 
- **Minecraft Version:** 1.21.11+ (support all 1.21.x minor versions)
 
- **Type:** Advanced Static + Manual Rotation Hologram System
 

  
# 🔹 CORE VISION
 
Build a **premium-quality hologram system** that:
 
 
- Supports **FULL FREE ROTATION (any angle, smooth)**
 
- Supports **per-player dynamic placeholders (especially %player_name%)**
 
- Provides **pixel-perfect positioning**
 
- Is **extremely smooth, no flicker, no glitches**
 
- Is **100% reload-safe**
 
- Works better than existing hologram plugins
 

  
# 🔹 🔥 ROTATION SYSTEM (MAIN FEATURE)
 
## ✅ Full Free Rotation
 
 
- Holograms must support: 
 
  - **0 → 360° yaw rotation**
 
  - Smooth transitions
 
  - No snapping unless specified
 

 
 

 
### Command:
 `/nbh rotate   `  
## 🧭 Quick Direction Rotation
 `/nbh face   ` 
 
-  
Instantly rotates hologram:
 
 
  - north → 180°
 
  - south → 0°
 
  - east → -90°
 
  - west → 90°
 

 
 
-  
Must be instant, no delay, no glitch
 
 

  
## 🪄 Wand Rotation
 
 
- Left-click: 
 
  - Rotate hologram +15° each click
 
  - Smooth update (no flicker)
 

 
 

  
# 🔹 📍 POSITION SYSTEM
 
## ✅ Pixel Perfect Placement
 
 
- Must support decimal positioning: `x: 10.347 y: 65.128 z: -22.889 ` 
 
- NO auto snapping by default
 
- Exact location must always be preserved
 

  
## 🪄 Dual Wand System
 
### 1. Normal Wand
 `/nbh wand  ` 
 
- Right-click: 
 
  - Moves hologram EXACTLY to hit position (free placement)
 

 
 
- Left-click: 
 
  - Rotate +15°
 

 
 

  
### 2. Fit Wand (NEW)
 `/nbh fitwand  ` 
 
-  
Right-click:
 
 
  - Ray trace surface
 
  - Snap perfectly to: 
 
    - Walls
 
    - Floors
 
    - Ceilings
 

 
 
  - Auto-align yaw
 

 
 
-  
Left-click:
 
 
  - Rotate smoothly
 

 
 

  
# 🔹 🎨 TEXT SYSTEM
 
## ✅ Full Formatting
 
 
- Supports: 
 
  - `&a`, `&l`, etc.
 
  - HEX `#FFFFFF`
 

 
 
- Must convert using Adventure API
 

  
## ✅ Multi-Line Support
 
 
- Unlimited lines
 
- Stored in `text.yml`
 
- Adjustable spacing
 

  
## 🌫️ Text Shadow
 
 
- Toggle per hologram
 

  
## 🎭 Background System
 
 
- Transparent OR colored
 

  
# 🔹 🔥 PLACEHOLDER SYSTEM (MOST IMPORTANT PART)
 
## ✅ PlaceholderAPI Integration
 
 
- Softdepend required
 
- Safe if missing
 

  
## ⚠️ PER-PLAYER PLACEHOLDERS (CRITICAL)
 
### MUST WORK PERFECTLY:
 
 
- `%player_name%` shows: 
 
  - The **viewer’s own name**
 
  - NOT shared
 
  - NOT cached globally
 

 
 

  
## ✅ REQUIRED SYSTEM DESIGN
 
 
- Each hologram must be: 
 
  - **Rendered per player**
 
  - **Updated per player**
 

 
 

 
### Use:
 `PlaceholderAPI.setPlaceholders(player, text) `  
## ❌ STRICTLY FORBIDDEN
 
 
- One hologram shared for all players with same placeholder result
 
- Global parsing like: `PlaceholderAPI.setPlaceholders(null, text) ` 
 
- Static cached placeholder values
 

  
## ⚡ REAL-TIME UPDATES
 
Config:
 `placeholder-refresh-interval: 20 ` 
 
- Must: 
 
  - Update without flicker
 
  - Not respawn entities every tick
 
  - Use smart caching
 

 
 

  
## 🧠 VIEWER SYSTEM (IMPORTANT)
 
Create a system like:
 
 
- `ViewerManager` 
 
  - Tracks players in range
 
  - Sends per-player updates
 
  - Handles join/quit
 
  - Handles world change
 

 
 

  
# 🔹 🔄 RELOAD SYSTEM
 
## `/nbh reload`
 
Must:
 
 
- Remove old entities
 
- Reload config + text.yml
 
- Rebuild holograms
 
- Re-attach viewers
 

 
## ❌ Must NOT:
 
 
- Duplicate holograms
 
- Break placeholders
 
- Cause flicker
 

  
# 🔹 COMMANDS
 `/nbh create   /nbh addline   /nbh removeline   /nbh movehere  /nbh move     /nbh rotate   /nbh face   /nbh textshadow   /nbh background   /nbh wand  /nbh fitwand  /nbh remove  /nbh reload /nbh help `  
# 🔹 FILE SYSTEM
 
## config.yml
 `text-shadow-default: true background-default: transparent line-spacing: 0.25 render-distance: 32 placeholder-refresh-interval: 20 debug-mode: false `  
## text.yml
 `holo1:   world: world   x: 10.347   y: 65.128   z: -22.889   yaw: 0   shadow: true   background: transparent   lines:     - "&aHello %player_name%"     - "#FFAA00Welcome back!" `  
# 🔹 TECHNICAL REQUIREMENTS
 
 
- Use TextDisplay entities
 
- ArmorStand fallback
 
- Async-safe updates
 
- No memory leaks
 
- Optimized rendering
 

  
# 🔹 ARCHITECTURE
 
 
- HologramManager
 
- ViewerManager ⭐ (core system)
 
- CommandManager
 
- WandManager
 
- PlaceholderHook
 

  
# 🔹 DEBUG SYSTEM
 
 
- Toggle in config
 
- Log: 
 
  - Placeholder parsing
 
  - Player updates
 
  - Entity spawning
 

 
 

  
# 🔹 FINAL GOAL
 
Create a plugin that:
 
✅ Shows correct `%player_name%` for EACH player ✅ Supports FULL smooth rotation ✅ Supports pixel-perfect placement ✅ Has ZERO flicker or glitch ✅ Is reload-safe ✅ Feels premium and modern
  
# ⚠️ FINAL WARNING
 
If:
 
 
- All players see same name ❌
 
- Hologram rotates automatically ❌
 
- Reload breaks system ❌
 

 
→ Implementation is WRONG
  
**END OF PROMPT**
Kodari AI
KodariApr 11 at 7:39 am 33,792 (v2)

I’ll create an advanced hologram plugin with per-player placeholder support and smooth rotation capabilities.

NyxBH
Advanced hologram system for Minecraft 1.21+ featuring per-player placeholder rendering, pixel-perfect positioning, and smooth 360° rotation. Supports TextDisplay entities with full Adventure API formatting, dynamic PlaceholderAPI integration, and dual wand system for intuitive placement. Includes smart ViewerManager for efficient per-player text updates without flicker, making every player see their own personalized hologram content.

I’ll create a comprehensive hologram plugin with per-player placeholder rendering using smart entity management.

All files created successfully! This advanced hologram plugin features:

Core Features:

  • Per-player placeholder rendering using smart entity hiding (each player sees their own %player_name%)

  • Full 360° rotation with pixel-perfect positioning

  • Dual wand system (normal + fit wand for surface snapping)

  • TextDisplay entities for modern Minecraft 1.21+ support

  • Adventure API for rich text formatting (legacy codes + hex colors)

Technical Implementation:

  • ViewerManager tracks which players see which holograms based on render distance

  • Each player gets their own TextDisplay entities (hidden from other players)

  • Placeholders update every 20 ticks (configurable) without flicker

  • Automatic proximity detection for viewer management

  • Smooth rotation using Transformation API

  • Complete reload safety with entity cleanup

Commands: All 13 commands implemented with tab completion, including create, addline, removeline, move, movehere, rotate, face, textshadow, background, wand, fitwand, remove, and reload.

bhanu.xd.

The hologram should be static. Don't follow towards players

Kodari AI
KodariApr 11 at 7:47 am 4,511 (v2)

I’ll read the relevant files to understand the current hologram implementation and locate the player-facing logic.

I found the issue. In ViewerManager.java, the holograms are set to use Display.Billboard.CENTER, which makes them always rotate to face players. I’ll change this to Display.Billboard.FIXED to make them static.

The hologram will now remain static and use the fixed yaw rotation set via the /nbh face or /nbh rotate commands instead of always facing towards players.

bhanu.xd.

Make it supports hex. Like we do &#eb2f2f must work

Kodari AI
KodariApr 11 at 8:12 am 3,656 (v2)

I’ll add hex color support to the plugin. Let me first read the relevant files to see how colors are currently being handled.

I can see the ColorUtil class already has hex color support but only for the #RRGGBB format. I’ll update it to also support the &#RRGGBB format you requested.

Updated ColorUtil to support both #eb2f2f and &#eb2f2f hex color formats by modifying the regex pattern to match an optional ampersand before the hash symbol.

bhanu.xd.

It can't detect the hex colour. It giving the wrong colour or sometimes doesn't work

Kodari AI
KodariApr 11 at 8:17 am 9,088 (v2)

I need to examine how hex colors are being handled in the plugin to identify the issue.

Let me check the HologramManager to see how colors are being applied:

I found the issue! The ColorUtil.java has a critical bug in the translateHexCodes method. When using matcher.appendReplacement(), the replacement string containing § characters needs to be properly escaped, otherwise it can cause incorrect color rendering or failures.

Additionally, the current implementation doesn’t handle edge cases well and could produce incorrect color codes.

Fixed the hex color detection issues:

  • Changed pattern to require &# prefix for consistency (e.g., &#FF5733)

  • Added alternative pattern for # without & (e.g., #FF5733)

  • Replaced StringBuffer with StringBuilder and manual string building to avoid appendReplacement escaping issues

  • Normalized hex codes to lowercase for consistency

  • Properly handles multiple hex codes in the same string

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
29 2,081
src/main/java/com/nyxstudios/nyxbh/NyxBH.java
package com.nyxstudios.nyxbh;

import com.nyxstudios.nyxbh.command.CommandManager;
import com.nyxstudios.nyxbh.config.ConfigManager;
import com.nyxstudios.nyxbh.hologram.HologramManager;
import com.nyxstudios.nyxbh.hologram.ViewerManager;
import com.nyxstudios.nyxbh.placeholder.PlaceholderHook;
import com.nyxstudios.nyxbh.wand.WandListener;
import com.nyxstudios.nyxbh.wand.WandManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class NyxBH extends JavaPlugin {
    
    private ConfigManager configManager;
    private HologramManager hologramManager;
    private ViewerManager viewerManager;
    private WandManager wandManager;
    private PlaceholderHook placeholderHook;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.loadConfigs();
        
        this.hologramManager = new HologramManager(this);
        this.viewerManager = new ViewerManager(this);
        this.wandManager = new WandManager(this);
        
        this.hologramManager.loadHolograms();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            this.placeholderHook = new PlaceholderHook();
            getLogger().info("PlaceholderAPI hooked successfully!");
        } else {
            getLogger().warning("PlaceholderAPI not found. Placeholder support disabled.");
        }
        
        new CommandManager(this);
        
        Bukkit.getPluginManager().registerEvents(new WandListener(this), this);
        
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            if (this.placeholderHook != null) {
                this.viewerManager.updateAllPlaceholders();
            }
        }, 20L, this.configManager.getPlaceholderRefreshInterval());
        
        getLogger().info("NyxBH has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (this.viewerManager != null) {
            this.viewerManager.removeAll();
        }
        getLogger().info("NyxBH has been disabled!");
    }
}