irido7

--- 📎 Attached 1 file(s):

File: BWRankTab_Final_Prompt.txt

txt
# BWRankTab – Complete Minecraft Plugin Development Prompt

## 1. Project Overview

Develop a professional Minecraft plugin named **BWRankTab** for Paper/Purpur servers.

The plugin must combine two independent systems into one plugin:

1. **BWRank System** – Custom ranks, LuckPerms integration, chat formatting and BedWars1058 integration.
2. **Custom Tab System** – A fully configurable, Hypixel BedWars-inspired player-list overlay.

The plugin must work with:
- Paper/Purpur
- BedWars1058
- LuckPerms
- PlaceholderAPI (optional)
- External TAB plugin (must not be required)

Do not require the TAB plugin for any core functionality.

## 2. Configuration Structure

Keep both systems separate.

Create:
- `config.yml` – Main plugin settings.
- `ranks.yml` – Rank management and formatting.
- `tab.yml` – Complete tab-list configuration.

Allow separate reload commands for each configuration.

## 3. BWRank System

Preserve the original BWRank functionality.

### LuckPerms Integration
- Automatically detect a player's LuckPerms group.
- Support configurable group-to-rank mappings.
- Support rank priorities when players have multiple groups.
- Allow custom rank names, prefixes, suffixes and colours.
- Provide a default rank for players without a configured group.

### Default Rank Prefixes

- VIP: `&a[VIP]`
- VIP+: `&a[VIP&6+]`
- MVP: `&b[MVP]`
- MVP+: `&b[MVP&c+]`
- MVP++: `&6[MVP&c++]`
- YouTube: `&c[YouTube]`
- HELPER: `&9[HELPER]`
- MOD: `&2[MOD]`
- ADMIN: `&c[ADMIN]`
- OWNER: `&c[OWNER]`

All ranks must be configurable through `ranks.yml`.

### Chat Formatting

Support:
- Lobby chat.
- BedWars1058 match chat.
- BedWars1058 team chat, where compatible.
- BedWars1058 shout messages.

Match chat format:

`TEAM NAME → RANK → PLAYER NAME → MESSAGE`

Shout messages must also display the player's rank without breaking BedWars1058's original shout functionality.

Do not replace or break BedWars1058's existing chat features.

### Rank Tab Prefixes

Support rank prefixes in the player list wherever the relevant tab system allows them.

Preserve BedWars1058's own match tab behaviour.

## 4. Custom Hypixel-Style Tab System

Create a custom tab-list system inspired by the Hypixel BedWars tab list.

The objective is to reproduce the overall appearance and layout as closely as technically possible.

### Visual Design

The tab list should have:

- A slightly transparent dark/black background, similar to Hypixel.
- Clean, organised player-name formatting.
- Properly aligned columns.
- Consistent spacing between entries.
- Header and footer.
- Player names, rank prefixes and colours.
- A professional Minecraft server design.
- Configurable text colours and formatting.

The tab overlay should resemble the normal Minecraft player-list overlay in its screen positioning and overall proportions.

Do not confuse the header/footer with the actual tab panel background. They are separate design elements.

### Important Technical Requirement

Investigate whether the desired background appearance, opacity and layout can be implemented using supported Minecraft protocol-level techniques.

A normal Paper API does not provide arbitrary control over the vanilla tab overlay's entire background or exact screen positioning.

If additional protocol-level or client-side methods are required, investigate their compatibility and explain the requirements.

Do not claim unsupported features work. Do not introduce unreliable hacks or require players to install client modifications without explicitly documenting that requirement.

If exact Hypixel-style rendering is impossible for unmodified vanilla clients, implement the closest reliable alternative and document the limitations.

### Header

Default example:

`&b&lMODERN ISLAND`
`&7Your Fight, Your Legacy`

Allow multiple header lines and fully configurable formatting.

### Footer

Default example:

`&7Online: &f%online%`
`&7Ping: &f%ping%ms`
`&7TPS: &f%tps%`

Allow multiple footer lines and configurable formatting.

## 5. Tab Configuration

Everything possible should be configurable through `tab.yml`, without rebuilding the plugin.

Include settings for:

- Enable/disable custom tab.
- Enabled worlds.
- Header and footer.
- Header/footer colours.
- Player-name format.
- Rank prefixes and suffixes.
- Column layout.
- Player sorting.
- Rank sorting priority.
- Text formatting.
- Background appearance, where technically supported.
- Update interval.
- Placeholder settings.
- Performance settings.

### Default World

The custom tab should only operate in:

`bwlobby2`

Allow administrators to add more worlds through configuration.

When a player enters an enabled world, activate the custom tab.

When they leave, restore the appropriate normal tab behaviour.

### Example Configuration

`tab.yml`
yaml tab: enabled: true

worlds: - bwlobby2

update-interval: 40

appearance: style: HYPIXEL_INSPIRED background: DARK transparency: true columns: AUTO

header: enabled: true lines: - "&b&lMODERN ISLAND" - "&7Your Fight, Your Legacy"

footer: enabled: true lines: - "&7Online: &f%online%" - "&7Ping: &f%ping%ms" - "&7TPS: &f%tps%"

player-format: enabled: true format: "%rank_prefix% &f%player%"

sorting: enabled: true mode: RANK_PRIORITY

placeholders: papi-support: true

code

The configuration is an example. Implement only settings that can actually be supported.

## 6. Internal Placeholders

Provide internal placeholders:

- `%player%`
- `%player_name%`
- `%rank%`
- `%rank_prefix%`
- `%rank_suffix%`
- `%ping%`
- `%online%`
- `%max_players%`
- `%tps%`
- `%server_name%`
- `%world%`
- `%world_players%`

Support PlaceholderAPI expansion when installed.

If PlaceholderAPI is unavailable, internal placeholders must continue working normally.

## 7. BedWars1058 Compatibility

This is extremely important.

- Do not interfere with BedWars1058 match tab lists.
- Do not overwrite BedWars1058's match scoreboard or placeholders.
- Do not break arena functionality.
- Do not modify BedWars1058's internal files.
- Do not replace its existing player-list handling during matches.
- The custom Hypixel-inspired tab should operate in `bwlobby2` by default.
- When a player joins a BedWars match, allow BedWars1058 to manage its match tab.

The plugin must detect the player's current game state and avoid conflicts.

## 8. External TAB Plugin Compatibility

The plugin must not require the external TAB plugin.

If TAB is installed:
- Detect possible conflicts.
- Display a clear console warning.
- Do not automatically disable or modify the external plugin.
- Provide documentation explaining how to configure both plugins without conflicts.

BWRankTab should own the custom tab in its configured lobby worlds, while BedWars1058 retains its match tab behaviour.

## 9. Commands and Permissions

Main command:

`/bwranktab`

Subcommands:

- `/bwranktab reload`
- `/bwranktab reload ranks`
- `/bwranktab reload tab`
- `/bwranktab check <player>`
- `/bwranktab debug`
- `/bwranktab tab preview`

Permission:

`bwranktab.admin`

Provide tab completion and clear command responses.

## 10. Performance and Stability

- Avoid unnecessary repeating tasks.
- Use efficient player updates.
- Do not update every player excessively.
- Prevent memory leaks.
- Handle player joins, quits and world changes correctly.
- Handle plugin reloads safely.
- Avoid conflicts with other plugins.
- Handle missing optional dependencies gracefully.
- Never spam console errors.

## 11. Development and Testing

Before implementation:

1. Inspect the actual BedWars1058 API and supported integration methods.
2. Verify LuckPerms integration.
3. Verify Paper/Purpur compatibility.
4. Research the Minecraft protocol requirements for the requested tab appearance.
5. Confirm which features work without client modifications.
6. Do not invent APIs, methods or placeholders.

Test:
- Lobby chat and tab formatting.
- BedWars1058 match chat.
- Shout formatting.
- Rank priority.
- World switching.
- Custom tab activation in `bwlobby2`.
- BedWars1058 match tab preservation.
- Header/footer placeholders.
- Configuration reloads.
- Compatibility with PlaceholderAPI and external TAB.

## 12. Deliverables

Provide:

- Complete Java source code.
- Compiled plugin JAR.
- `plugin.yml`.
- Default configuration files.
- Installation instructions.
- Configuration documentation.
- Supported-version information.
- Known limitations and compatibility notes.

The final plugin must be a single plugin containing both the BWRank and custom tab systems.

**Final priority:** Create a stable, configurable BWRankTab plugin that reproduces the Hypixel BedWars tab-list appearance as closely as possible, while preserving BedWars1058 functionality and avoiding unsupported visual features.

Kodari AI
KodariNov 1 at 7:52 pm 2
BWRankTab
BWRankTab is a dual-system Minecraft plugin combining custom rank management with a Hypixel-inspired tab list overlay. It integrates LuckPerms for rank detection, configurable prefixes, and chat formatting for lobby and BedWars1058 matches. The custom tab system features configurable headers, footers, player formatting, and rank-based sorting, operating only in specified lobby worlds to preserve BedWars1058's match tab behavior. Includes internal placeholders, PlaceholderAPI support, and comprehensive reload commands.
  1. Create the Paper plugin scaffold and separate main, ranks, and tab configuration.

  2. Implement LuckPerms rank resolution, lobby chat formatting, and configurable tab/header/footer updates.

  3. Add admin commands, optional PlaceholderAPI support, and safeguards that leave BedWars match tabs untouched.

  4. Document vanilla-client rendering limits and integration setup.

Created BWRankTab for Paper/Purpur 1.21.4+ (Java 21), with separate config.yml, ranks.yml, and tab.yml. It includes LuckPerms rank mapping and priorities, lobby chat formatting, configurable tab header/footer and player names, internal placeholders, optional PlaceholderAPI support, and the requested admin commands.

The vanilla client does not allow plugins to control the tab panel’s background opacity, position, or columns. BedWars1058 match players’ tab names and native chat/shout are left untouched; rank formatting for BedWars-native team chat and shout is not implemented. See README.md for setup and compatibility notes.

irido7

Not loading showing in red

Kodari AI
KodariNov 2 at 7:35 pm 1
  1. Check the plugin metadata, build dependencies, and startup code for a load failure.

  2. Fix the cause and leave unrelated features unchanged.

The plugin metadata and startup code look valid, so I can’t identify the load failure from the source alone. Red in /plugins means the server disabled it—please paste the full startup error/stack trace around BWRankTab (and your Paper/Purpur and Java versions); that will show what needs fixing.

irido7

No specific error it's showing could not load bwranktab

Kodari AI
KodariNov 2 at 7:37 pm 1

The generation was stopped before any content could be produced.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
15 961
src/main/java/com/modernisland/bwranktab/BWRankTabPlugin.java
package com.modernisland.bwranktab;

import com.modernisland.bwranktab.command.BWRankTabCommand;
import com.modernisland.bwranktab.rank.RankManager;
import com.modernisland.bwranktab.tab.TabManager;
import com.modernisland.bwranktab.listener.ChatListener;
import com.modernisland.bwranktab.listener.PlayerListener;
import com.modernisland.bwranktab.util.ReflectionSupport;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public final class BWRankTabPlugin extends JavaPlugin {
    private final Set<UUID> bedWarsPlayers = ConcurrentHashMap.newKeySet();
    private Object luckPerms;
    private Object bedWarsArenaUtil;
    private RankManager rankManager;
    private TabManager tabManager;
    private volatile boolean lobbyChatEnabled;
    private volatile String lobbyChatFormat;
    private volatile boolean debugEnabled;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResourceIfMissing("ranks.yml");
        saveResourceIfMissing("tab.yml");
        refreshMainSettings();
        setupLuckPerms();
        setupBedWars1058();

        rankManager = new RankManager(this);
        rankManager.reload();
        tabManager = new TabManager(this);
        tabManager.reload();

        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);

        BWRankTabCommand command = new BWRankTabCommand(this);
        getCommand("bwranktab").setExecutor(command);
        getCommand("bwranktab").setTabCompleter(command);

        if (Bukkit.getPluginManager().isPluginEnabled("TAB")) {
            getLogger().warning("TAB is installed. Configure TAB to avoid managing BWRankTab's lobby world; no plugin was disabled or modified.");
        }
        if (Bukkit.getPluginManager().isPluginEnabled("BedWars1058") && bedWarsArenaUtil == null) {
            getLogger().warning("BedWars1058 is present, but its public API service was not available. Match-state protection cannot be confirmed.");
        }

        Bukkit.getScheduler().runTaskTimer(this, this::refreshBedWarsPlayers, 1L, 10L);
        tabManager.start();
        getLogger().info("BWRankTab enabled.");
    }

    @Override
    public void onDisable() {
        if (tabManager != null) {
            tabManager.stop();
        }
    }

    private void saveResourceIfMissing(String path) {
        if (!getDataFolder().toPath().resolve(path).toFile().exists()) {
            saveResource(path, false);
        }
    }

    private void setupLuckPerms() {
        if (!Bukkit.getPluginManager().isPluginEnabled("LuckPerms")) {
            getLogger().warning("LuckPerms is not installed; configured default ranks will be used.");
            return;
        }
        try {
            Class<?> provider = Class.forName("net.luckperms.api.LuckPermsProvider", true, getClass().getClassLoader());
            luckPerms = provider.getMethod("get").invoke(null);
        } catch (ReflectiveOperationException | LinkageError exception) {
            getLogger().warning("Could not connect to the LuckPerms API; configured default ranks will be used.");
        }
    }

    private void setupBedWars1058() {
        if (!Bukkit.getPluginManager().isPluginEnabled("BedWars1058")) {
            return;
        }
        try {
            Class<?> bedWarsType = Class.forName("com.andrei1058.bedwars.api.BedWars", true, getClass().getClassLoader());
            RegisteredServiceProvider<?> registration = Bukkit.getServicesManager().getRegistration(bedWarsType);
            if (registration != null) {
                Object api = registration.getProvider();
                bedWarsArenaUtil = ReflectionSupport.invoke(api, "getArenaUtil");
            }
        } catch (ReflectiveOperationException | LinkageError exception) {
            getLogger().warning("Could not connect to the BedWars1058 public API; match-state protection is unavailable.");
        }
    }

    private void refreshBedWarsPlayers() {
        if (bedWarsArenaUtil == null) {
            return;
        }
        Set<UUID> current = new HashSet<>();
        try {
            for (Player player : Bukkit.getOnlinePlayers()) {
                boolean playing = Boolean.TRUE.equals(ReflectionSupport.invoke(bedWarsArenaUtil, "isPlaying", player));
                boolean spectating = Boolean.TRUE.equals(ReflectionSupport.invoke(bedWarsArenaUtil, "isSpectating", player));
                if (playing || spectating) {
                    current.add(player.getUniqueId());
                }
            }
        } catch (ReflectiveOperationException | RuntimeException exception) {
            getLogger().warning("BedWars1058 match-state lookup failed; match-state protection has been disabled.");
            bedWarsArenaUtil = null;
            bedWarsPlayers.clear();
            return;
        }
        if (!current.equals(bedWarsPlayers)) {
            bedWarsPlayers.clear();
            bedWarsPlayers.addAll(current);
            if (tabManager != null) {
                tabManager.refreshAll();
            }
        }
    }

    private void refreshMainSettings() {
        lobbyChatEnabled = getConfig().getBoolean("chat.enabled", true);
        lobbyChatFormat = getConfig().getString("chat.format", "%rank_prefix% &f%player%%rank_suffix%&7: &f%message%");
    }

    public void reloadMainConfig() {
        reloadConfig();
        refreshMainSettings();
    }

    public boolean isBedWarsPlayer(Player player) {
        return bedWarsPlayers.contains(player.getUniqueId());
    }

    public boolean hasActiveBedWarsMatches() {
        return !bedWarsPlayers.isEmpty();
    }

    public Object getLuckPerms() {
        return luckPerms;
    }

    public RankManager getRankManager() {
        return rankManager;
    }

    public TabManager getTabManager() {
        return tabManager;
    }

    public boolean isLobbyChatEnabled() {
        return lobbyChatEnabled;
    }

    public String getLobbyChatFormat() {
        return lobbyChatFormat;
    }

    public boolean isDebugEnabled() {
        return debugEnabled;
    }

    public boolean toggleDebug() {
        debugEnabled = !debugEnabled;
        return debugEnabled;
    }
}