boopluka

make a plugin thats based on this https://youtu.be/GEq2O1ktBFA?si=ztV8s6f2Cj2-A-qr , so when people join , they get assigned ranking randomly . only rank 1 to rank 3 gets a special hp boost like 40 hp instead of normal hp 20. please make the prefix like luckperms think of it as a rank but it really isnt.

Kodari AI
KodariJan 1 at 5:44 pm 6,626 (v2)

I’ll create a random ranking plugin where players get assigned ranks 1-100 on first join, with ranks 1-3 receiving 40 HP and prefix display.

RandomRankRoulette
A ranking system that randomly assigns players a rank from 1-100 on first join. Players ranked 1-3 receive a permanent health boost of 40 HP instead of the standard 20 HP. All ranks are displayed as chat and tab prefixes similar to LuckPerms, creating a competitive hierarchy based purely on join luck. Includes admin commands to reassign ranks and view player rankings.

Plugin created! RandomRankRoulette assigns players a random rank (1-100) on first join. Ranks 1-3 get 40 HP and special colored prefixes (gold, yellow, green). All ranks display as chat/tab prefixes like LuckPerms. Use /rerollrank <player> as admin to reassign ranks.

boopluka

actually, please make the assigning like if only 100 ppl joined the game ONLY not including offline, they get assigned ranks randomly. also when ppl fight like rank 11 fights rank 2 , if the rank 2 lose then rank 2 gets their rank to rank 7 and rank 11 gets to rank 6, if rank 1 and rank 2 fight , and rank 1 lost, rank 2 becomes rank 1

Kodari AI
KodariJan 1 at 5:49 pm 9,438 (v2)

I’ll read the current files to understand the system, then modify it to:

  • Only assign ranks when 100 players have joined (online count)

  • Add PvP combat rank changes with the rules you specified

Now I’ll modify the system to:

  1. Only assign ranks when 100 unique players have joined (not offline count)

  2. Add PvP combat listener with rank swapping logic

  3. Update RankManager to handle rank swapping

Done! The system now:

  1. Only assigns ranks when < 100 players have joined - tracks total unique players, not online count

  2. Each rank is unique - no duplicate ranks assigned

  3. PvP rank changes:

    • Rank 11 kills Rank 2 → Killer becomes Rank 6, Victim becomes Rank 7 (midpoint logic)

    • Rank 2 kills Rank 1 → Rank 2 becomes Rank 1, old Rank 1 becomes Rank 2

    • Only works when lower rank (higher number) kills higher rank (lower number)

  4. Health updates automatically when ranks change

  5. Messages notify both players of rank changes

boopluka

make it support mc versions like 1.19 to latest

Kodari AI
KodariJan 1 at 5:50 pm 6,091 (v2)

I’ll analyze the code and update it to support MC 1.19+ using XSeries for cross-version compatibility.

I can see the code already uses XAttribute for cross-version compatibility, which is good. However, I need to ensure XSeries is properly included in the build.gradle. The code is already mostly compatible, but I’ll verify the build configuration is correct for 1.19+ support.

The plugin now supports MC 1.19 to latest versions. Key changes:

  • Updated Spigot API to 1.19 baseline (compatible with all newer versions)

  • Added XSeries 11.3.0 for cross-version compatibility

  • XAttribute already used throughout for health modifications (works 1.19-1.21+)

  • Legacy color codes (&) used instead of version-specific components

  • All existing code already compatible with 1.19+ through XSeries wrappers

boopluka

make it support essentialx or essential

Kodari AI
KodariJan 1 at 5:59 pm 14,832 (v2)

I’ll add EssentialsX support to the plugin. Let me first read the relevant files to understand the current implementation.

Now I’ll add EssentialsX support to integrate with their nickname system. I need to:

  • Add EssentialsX as a soft dependency

  • Hook into EssentialsX to update nicknames when ranks change

  • Make it optional so the plugin works without EssentialsX

EssentialsX support has been added! The plugin now:

  • Hooks into EssentialsX automatically when available (soft dependency)

  • Updates player nicknames with rank prefixes when ranks change

  • Works without EssentialsX - all features are optional and won’t break if Essentials isn’t installed

  • Configurable - you can enable/disable the integration and customize the nickname format in config.yml

The integration updates nicknames on:

  • Player join

  • Rank assignment

  • Rank changes from PvP

  • Manual rank rerolls

You can configure it in config.yml under settings.essentials to enable/disable or change the nickname format.

boopluka

what plugins are needed to depend on it to work?

Kodari AI
KodariJan 1 at 6:00 pm 5,807 (v2)

Based on the code analysis:

Required Dependencies

Hard Dependencies (REQUIRED):

  • None - the plugin will start without any other plugins

Soft Dependencies (OPTIONAL):

  • Essentials/EssentialsX - Listed in plugin.yml as softdepend: [Essentials]

    • Used for nickname integration (updating player nicknames with rank prefixes)

    • Plugin works fine without it - the EssentialsHook class gracefully handles when Essentials is not present

    • Can be enabled/disabled in config with settings.essentials.enabled

Summary

The plugin is fully standalone and doesn’t require any other plugins to function. Essentials is completely optional and only adds the nickname feature if present.

boopluka

please add more commands for admins

Kodari AI
KodariJan 1 at 6:02 pm 11,085 (v2)

I’ll read the existing code to understand the plugin structure and then add useful admin commands.

Now I’ll create comprehensive admin commands for the plugin:

  • /randomrank reload - Reload configuration

  • /randomrank reset <player> - Reset a player’s rank completely

  • /randomrank setrank <player> <rank> - Set a specific rank

  • /randomrank top [amount] - View top ranked players

  • /randomrank stats - View plugin statistics

  • /randomrank swap <player1> <player2> - Swap two players’ ranks

Added comprehensive admin commands:

  • /randomrank reload - Reload config

  • /randomrank reset <player> - Remove player’s rank completely

  • /randomrank setrank <player> <rank> - Assign specific rank (handles conflicts)

  • /randomrank top [amount] - View leaderboard (default 10, max 50)

  • /randomrank stats - Plugin statistics

  • /randomrank swap <p1> <p2> - Swap two players’ ranks

  • Tab completion for all commands

  • Aliases: /rr and /rrr

boopluka

make it support luckperms too

Kodari AI
KodariJan 1 at 6:04 pm 16,463 (v2)

I’ll add LuckPerms support to the plugin. Let me first read the existing files to understand the current structure.

I’ll add LuckPerms support to the plugin. This will allow the plugin to integrate with LuckPerms for permission-based rank management.

Plan:

  • Create LuckPermsHook class for LuckPerms integration

  • Update RankManager to support LuckPerms group assignment

  • Update config.yml with LuckPerms settings

  • Update main class to initialize LuckPerms hook

  • Add LuckPerms as compileOnly dependency

LuckPerms support has been added! The plugin now integrates with LuckPerms to automatically assign groups based on player ranks.

Features added:

  • LuckPermsHook class with methods to manage groups

  • Three modes: add (adds group), set (replaces all groups), primary (sets primary group)

  • Configurable group format (e.g., rank_1, rank_2, etc.)

  • Automatic group assignment when ranks change

  • LuckPerms dependency added to build.gradle

Configuration: Enable LuckPerms in config.yml:

YAML
luckperms:
  enabled: true
  mode: 'add'  # Options: add, set, primary
  group-format: 'rank_{rank}'  # Creates groups like rank_1, rank_2, etc.

The plugin will automatically assign LuckPerms groups when players get ranks, change ranks, or have their ranks modified by admins.

boopluka

add special perks for rank 1 to rank 3 with hp boost permenantly until they lose rank 1 to rank 3. rank 4 - rank inf will remain 20hp while rank 1 to rank 3 will get 40 hp

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
15 1,295
src/main/java/com/randomrank/RandomRankRoulette.java
package com.randomrank;

import com.randomrank.commands.RankCommand;
import com.randomrank.commands.RandomRankCommand;
import com.randomrank.commands.RerollRankCommand;
import com.randomrank.hooks.EssentialsHook;
import com.randomrank.hooks.LuckPermsHook;
import com.randomrank.listeners.PlayerJoinListener;
import com.randomrank.listeners.PlayerChatListener;
import com.randomrank.listeners.PlayerDeathListener;
import com.randomrank.managers.RankManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class RandomRankRoulette extends JavaPlugin {
    
    private RankManager rankManager;
    private EssentialsHook essentialsHook;
    private LuckPermsHook luckPermsHook;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.essentialsHook = new EssentialsHook();
        this.luckPermsHook = new LuckPermsHook();
        this.rankManager = new RankManager(this);
        
        if (essentialsHook.isEnabled()) {
            getLogger().info("EssentialsX integration enabled!");
        }
        
        if (luckPermsHook.isEnabled()) {
            getLogger().info("LuckPerms integration enabled!");
        }
        
        getServer().getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerChatListener(this), this);
        getServer().getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        
        getCommand("rank").setExecutor(new RankCommand(this));
        getCommand("rerollrank").setExecutor(new RerollRankCommand(this));
        getCommand("randomrank").setExecutor(new RandomRankCommand(this));
        
        getLogger().info("RandomRankRoulette has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (rankManager != null) {
            rankManager.saveData();
        }
        getLogger().info("RandomRankRoulette has been disabled!");
    }
}