Navrit Gaming
📎 1 file 3,849 chars
📄
pasted-code-1788792143912.txt
txt 83 lines
▶
Act as an expert Senior Minecraft Java Plugin Developer. Create a FULL, STABLE, and EXHAUSTIVE Paper Minecraft plugin compatible with 1.21+ (including 1.21.1 and all 1.21.x releases) running strictly on a Java 21 environment.

### Plugin Identity & Author Credits:
- Plugin Name: XenHolo
- Developer / Author: Khairul Baria
- Main Package: com.khairulbaria.xenholo
- Include "author: Khairul Baria" inside plugin.yml.
- Print an explicit server startup log message in onEnable(): "Developed by Khairul Baria".

### Core Architectural Requirement:
Build a complete 1:1 functional clone of FancyHolograms using Paper's native Display Entities (TextDisplay, ItemDisplay, BlockDisplay). Do NOT use ArmorStands. Code MUST be built natively for Java 21 without using Java 22+ preview features or internal bytecode dependencies, guaranteeing zero Docker/JVM conflicts on Pterodactyl hosts.

Do NOT provide incomplete code or placeholders (e.g., "// TODO: implement remaining commands"). Implement the full command framework supporting every single subcommand listed below.

---

### EXACT COMMAND STRUCTURE TO IMPLEMENT (/hologram or /xenholo):

1. Core Management Commands:
   - /hologram help
   - /hologram list
   - /hologram nearby 
   - /hologram create (text|item|block) (name)
   - /hologram remove (hologram)
   - /hologram copy (hologram) (new_name)
   - /hologram info (hologram)

2. General Hologram Modifications (/hologram edit  ...):
   - ... moveHere (Alias: position)
   - ... moveTo (x) (y) (z) [yaw] [pitch]
   - ... rotate (degrees)
   - ... rotatepitch (degrees)
   - ... translate (x) (y) (z)
   - ... visibilityDistance (distance)
   - ... visibility (ALL | MANUAL | PERMISSION_NEEDED)
   - ... scale (factor)
   - ... billboard (center | fixed | vertical | horizontal)
   - ... shadowStrength (strength)
   - ... shadowRadius (radius)
   - ... linkWithNpc (npc)
   - ... unlinkWithNpc

3. Text Hologram Specific Modifications:
   - ... setLine (line) (text...)
   - ... addLine (text...)
   - ... removeLine (line)
   - ... insertBefore (line) (text...)
   - ... insertAfter (line) (text...)
   - ... updateTextInterval (ticks|seconds|minutes)
   - ... background (hex_color|transparent)
   - ... textShadow (true|false)
   - ... brightness (block|sky) (0-15)
   - ... textAlignment (center|left|right)

4. Item & Block Display Modifications:
   - ... item (uses item held in main hand)
   - ... block (block_type)

5. Admin / System Commands (/fancyholograms or /xenholo-admin):
   - /xenholo-admin version
   - /xenholo-admin save
   - /xenholo-admin reload
   - /xenholo-admin convert DecentHolograms <*|name> [--processIcons]

---

### EXTRA ADVANCED FEATURES (Added by Khairul Baria):
1. Interactive Click Actions:
   - Syntax: /hologram edit (hologram) setAction (left|right) (command...)
   - Triggers console or player commands upon interaction with the Display Entity.
2. Particle Aura Animations:
   - Syntax: /hologram edit (hologram) particle (type|none)
   - Spawns animated particle loops around the hologram base.
3. PlaceholderAPI & Vault Integration:
   - Native PAPI placeholder parsing updated per the configured `updateTextInterval`.

---

### Technical Guidelines & Source Files Needed:
- Complete `pom.xml` with Paper API 1.21-R0.1-SNAPSHOT & PlaceholderAPI dependencies.
- Complete `plugin.yml` with `api-version: '1.21'` and `author: Khairul Baria`.
- Full Java code architecture using modular classes (`XenHoloMain.java`, `HologramManager.java`, `DisplayEntityHandler.java`, `HologramCommand.java`, `ConvertManager.java`, `HologramData.java`).
- Full YML storage implementation (`holograms.yml`) saving location, scale, rotation, brightness, billboard, lines, items, and click actions across server restarts.
Kodari AI
KodariSep 7 at 2:46 pm 20
XenHolo
XenHolo is a comprehensive Paper plugin for 1.21+ that recreates FancyHolograms functionality using native Display Entities (TextDisplay, ItemDisplay, BlockDisplay). It features a complete command framework for creating, editing, and managing holograms with text, item, and block types. Advanced capabilities include interactive click actions, particle aura animations, PlaceholderAPI integration, and Vault support. The plugin provides persistent YAML storage, admin commands for saving/reloading/converting from DecentHolograms, and full control over visual properties like scale, rotation, billboard, brightness, and shadows. Built for Java 21 with modular architecture, it delivers a stable, production-ready hologram solution.
  1. Create the Paper/Maven project metadata, commands, permissions, and persistent configuration.

  2. Build display-entity hologram storage, rendering, visibility, interaction, animation, placeholders, and conversion services.

  3. Implement the player/admin command frameworks and event handling for every requested subcommand.

Created the XenHolo Paper 1.21+/Java 21 plugin project with:

  • Maven configuration, Paper API, PlaceholderAPI, plugin metadata, commands, aliases, and permissions.

  • Persistent holograms.yml storage for hologram location, display settings, text, items, actions, particles, and linked entities.

  • Display-entity holograms with text, item, interaction actions, particle auras, visibility modes, PlaceholderAPI updates, and NPC/entity linking.

  • Complete /hologram and /xenholo-admin command frameworks, including editing, saving, reloading, information, copying, nearby lookup, and DecentHolograms conversion.

  • Startup credit logging: Developed by Khairul Baria.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
12 1,550
src/main/java/com/khairulbaria/xenholo/XenHoloMain.java
package com.khairulbaria.xenholo;

import com.khairulbaria.xenholo.command.AdminCommand;
import com.khairulbaria.xenholo.command.HologramCommand;
import com.khairulbaria.xenholo.listener.DisplayEntityHandler;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitTask;

import java.util.Objects;

public final class XenHoloMain extends JavaPlugin {
    private HologramManager hologramManager;
    private ConvertManager convertManager;
    private BukkitTask updateTask;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        hologramManager = new HologramManager(this);
        hologramManager.load();
        convertManager = new ConvertManager(this, hologramManager);

        HologramCommand hologramCommand = new HologramCommand(this, hologramManager);
        PluginCommand hologram = Objects.requireNonNull(getCommand("hologram"));
        hologram.setExecutor(hologramCommand);
        hologram.setTabCompleter(hologramCommand);

        AdminCommand adminCommand = new AdminCommand(this, hologramManager, convertManager);
        PluginCommand admin = Objects.requireNonNull(getCommand("xenholo-admin"));
        admin.setExecutor(adminCommand);
        admin.setTabCompleter(adminCommand);

        Bukkit.getPluginManager().registerEvents(new DisplayEntityHandler(this, hologramManager), this);
        updateTask = Bukkit.getScheduler().runTaskTimer(this, hologramManager::tick, 1L, 1L);
        getLogger().info("Developed by Khairul Baria");
    }

    @Override
    public void onDisable() {
        if (updateTask != null) {
            updateTask.cancel();
        }
        if (hologramManager != null) {
            hologramManager.shutdown();
        }
    }

    public HologramManager getHologramManager() {
        return hologramManager;
    }
}