kuroo.you

Create a highly optimized, feature-rich Paper/Spigot Minecraft plugin (supporting 1.16 to latest 1.21+) named "UltimateKingSMP". The plugin introduces a competitive "King of the SMP" gamemode complete with particle animations, level progression, redemption quests, guard management, bounty mechanics, and custom boss buffs.

--- Core Mechanics ---

  1. First 5 Kills Milestone:

- When the SMP starts, the first player to hit 5 player kills automatically becomes the "King". - Plays a global server-wide epic animation (Ender Dragon sound effect, firework explosion at player location, bold Title/Subtitle announcement across all players' screens).

  1. King Leveling & Progression (Level 1 to 10):

- The King starts at Level 1 and gains XP towards King Levels through kills, playtime, and boss slays. - Passive Buffs per Level (configurable in config.yml): - Level 1: Speed I, Night Vision - Level 3: Regeneration I, Resistance I - Level 5: Strength I, Custom Max Health Boost (+4 Hearts) - Level 8: Fire Resistance, Knockback Resistance (+20%) - Level 10 (MAX): Jump Boost II, Strength II, God-tier golden crown aura, and "Rally Cry" active ability.

  1. Crown Loss & 5-Task Redemption Challenge:

- If the King dies 3 times to other players, they lose the crown. - The player who killed the King gains the right to claim the crown by completing 5 timed tasks (e.g., within 30 minutes). - Random Task Pool: - "Kill 3 different players" - "Mine 32 Diamond Ores" - "Survive in Nether for 10 minutes without taking fire damage" - "Tame a Horse/Wolf" - "Craft 5 Golden Apples" - Real-time countdown and active task progress displayed on the player's Action Bar. - If time expires, the crown drops as a physical legendary helmet item on the ground for anyone to steal!

--- NEW Exclusive Features ---

  1. King's Guard System:

- The active King can designate up to 2 online players as "Royal Guards" using /king guard add <player>. - Guards receive passive Speed I & Resistance I whenever they stay within 15 blocks of the King. - If a Guard sacrifices themselves (dies) while near the King, the King instantly gets 5 seconds of Regeneration III and Absorption II.

  1. King Bounty System:

- Every 10 minutes the King remains alive and unbeaten, a global bounty increases on their head (e.g., Diamonds, Netherite, or Economy money added automatically to the reward pool). - Any regular player who slays the King collects the accrued bounty immediately!

  1. King's Rally Cry (Active Ability - 5 Minute Cooldown):

- Command: /king ability - Triggers a wave of golden particles extending 10 blocks outward. - Nearby teammates/guards get Strength I & Speed II for 15 seconds, while nearby enemies receive Slowness I and Darkness for 5 seconds.

  1. Dynamic BossBar & UI:

- A persistent, sleek BossBar at the top of the screen displaying: "👑 Current King: [PlayerName] | Level [X] | Bounty: [X] Diamonds" - Customizable color and style in config.yml (e.g., GOLD, SOLID).

--- Visuals & Audio FX ---

  1. King's Crown & Particle Aura:

- Floating particle halo/crown above the King's head (FLAME + SPELL_WITCH blend running asynchronously for zero TPS lag). - As the King levels up, the aura becomes bigger and denser.

  1. GUI Menu (/king):

- Interactive chest GUI displaying: - Current King Profile & Statistics (Kills, Deaths, Active Level) - Active Buffs & Unlocks - Current Redemption Tasks & Live Timers - King Leaderboard (Top historical Kings) - Royal Guards List

--- Commands & Permissions ---

  • /king - Opens main King GUI
  • /king ability - Uses active King skill (Level 5+ required)
  • /king guard <add/remove> <player> - King manages guards
  • /king top - Displays top Kings leaderboard
  • /king admin setking <player> - Admin force set King
  • /king admin setlevel <player> <level> - Admin change King level
  • /king admin reset - Resets current King state

Permissions:

  • ultimatekingsamp.use (Default for all players)
  • ultimatekingsamp.king (Auto-granted to active King)
  • ultimatekingsamp.admin (Admin commands)

--- Technical Requirements ---

  • Fully persistent data using SQLite or YAML files to save King state, XP, and timers through server restarts.
  • 100% customizable config.yml for all messages, colors, particle types, buff strengths, task lists, and sound effects.
  • Multi-version compatibility (Spigot / Paper API).
  • Optimized code with asynchronous particle rings and task loops to prevent server lag. Add an ASCII banner on console when server starts plugin development credit goes to KazameKuroo
Kodari AI
KodariNov 6 at 4:31 am 4
UltimateKingSMP
A competitive King of the SMP gamemode plugin where the first player to reach 5 kills becomes King. Features 10 levels of progressive buffs, particle crown auras, a 5-task timed redemption challenge when the King dies 3 times, royal guard management with proximity buffs, an escalating bounty system, and a Rally Cry active ability with cooldown. Includes a dynamic BossBar UI, interactive /king GUI menu, leaderboard tracking, full persistence via YAML, and fully configurable settings. Optimized with async particle systems for zero TPS impact.
  1. Build the persistent king, progression, redemption, guard, bounty, and ability systems.

  2. Add the menu, boss bar, effects, commands, and configuration for Paper and Spigot.

Created UltimateKingSMP with persistent king progression, redemption challenges, guards, diamond bounties, Rally Cry, a boss bar, and a /king menu.

A few limits: the redemption tasks are configurable but not randomly selected, shift-clicked golden apples don’t count, and particle effects run synchronously for Bukkit safety. Not every message or effect is configurable yet, and compatibility across all requested versions has not been verified.

kuroo.you

Add admin 10+ commands which can reset king restart kings smp etc when an admin does /kingdom start then play 10s timer on screen and start 5 minute grace period in which no one can kill anyone pvp is off after 5 mints broadcast on screen that Hexacore s9 started kings smp and bliss smp plugin and execute. A command/gems smp start after this kings smp plugin begins and if King stays offline for one day his crown will be given to a random player in smp admin can end grace reset plugin etc

Kodari AI
KodariNov 6 at 4:54 am 7
  1. Add an admin-controlled start countdown, grace period, and SMP lifecycle commands.

  2. Transfer the crown after a King has been offline for one day.

Added /kingdom start with a 10-second countdown, five-minute PvP grace period, and start announcement. When grace ends, the plugin runs gems smp start from the console; that command is configurable and requires the other plugin to provide it.

Added 15 admin controls, including /kingdom restart, stop, endgrace, grace, reset, and resetall. Use /kingdom to see the full list.

A King offline for 24 hours loses the crown to a random online player. If no eligible player is online, the transfer waits until one is available. Timer and lifecycle state persist across restarts.

kuroo.you

Plugin is good but make it more attractive and professional add sounds in starting countdown and when grace starts play 5 mints countdown on players hotbar add sounds and effects don't give vanilla effects to the king give him custom powers like dash freez etc when anyone becomes king give him 2 vendicator guards which will protect king and when anyone king orders guards to kill anyone then gurds will do that this are level guards which will become powerful when king levels up when any newbie joins give him a tutorial book of kings smp plugin add auto tab complete in commands make plugin 100x better and feel premium don't show levels in bar just show king and his kills

Kodari AI
KodariNov 6 at 5:38 am 19
  1. Polish the start countdown, grace timer, and King boss bar.

  2. Replace King potion buffs with custom powers.

  3. Add level-scaling Vindicator guards and attack orders.

  4. Give new players a tutorial book.

  5. Add command tab completion.

Added the premium updates:

  • Countdown sounds and effects, a live grace-period action bar, and a boss bar showing only the King and kills.

  • Custom Dash and Freeze powers; the King no longer receives the plugin’s potion buffs.

  • Two level-scaling Vindicator guards. Use /king guard attack <player> to order them and /king guard stop to recall them.

  • A first-join tutorial book, interactive dashboard, and command tab completion.

In-game testing across the supported Paper and Spigot versions is still needed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 1,029
src/main/java/com/kazamekuroo/ultimatekingsmp/UltimateKingSMP.java
package com.kazamekuroo.ultimatekingsmp;

import com.cryptomorin.xseries.XAttribute;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Firework;
import org.bukkit.entity.Item;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Vindicator;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.EntityTameEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.EntityEquipment;
import org.bukkit.inventory.meta.FireworkMeta;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.BookMeta;
import org.bukkit.permissions.PermissionAttachment;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.util.Vector;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;

public class UltimateKingSMP extends JavaPlugin implements Listener {
    private UUID king, claimant;
    private int level = 1, xp, deaths, bounty, diamonds, netherSeconds, apples;
    private long deadline, nextBounty, abilityReady, dashReady, freezeReady;
    private long phaseDeadline, kingOfflineSince;
    private String phase = "STOPPED";
    private final Random random = new Random();
    private boolean tamed, crownDropped;
    private Location crownLocation;
    private final Set<UUID> guards = new HashSet<>(), victims = new HashSet<>();
    private final Map<UUID, Integer> kills = new HashMap<>(), history = new HashMap<>(), kingKills = new HashMap<>(), kingDeaths = new HashMap<>();
    private final Map<UUID, Long> frozen = new HashMap<>();
    private final Map<Integer, UUID> royalGuardIds = new HashMap<>();
    private final Map<Integer, Long> royalGuardRespawns = new HashMap<>();
    private UUID royalTarget;
    private long royalTargetUntil;
    private boolean royalOrdered;
    private final Map<UUID, PermissionAttachment> attachments = new HashMap<>();
    private File dataFile;
    private YamlConfiguration data;
    private BossBar bar;
    private NamespacedKey crownKey;
    private long ticks;
    private long lastCountdownSecond = -1, lastGraceReminder = -1;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        crownKey = new NamespacedKey(this, "legendary_crown");
        dataFile = new File(getDataFolder(), "data.yml");
        data = YamlConfiguration.loadConfiguration(dataFile);
        loadState();
        if (king != null && Bukkit.getPlayer(king) != null && kingOfflineSince > 0 && System.currentTimeMillis() - kingOfflineSince < Math.max(1, getConfig().getLong("lifecycle.offline-transfer-seconds", 86400)) * 1000L) kingOfflineSince = 0;
        else if (king != null && kingOfflineSince == 0) kingOfflineSince = System.currentTimeMillis();
        BarColor color;
        BarStyle style;
        try { color = BarColor.valueOf(getConfig().getString("bossbar.color", "YELLOW").toUpperCase()); } catch (IllegalArgumentException ex) { color = BarColor.YELLOW; }
        try { style = BarStyle.valueOf(getConfig().getString("bossbar.style", "SOLID").toUpperCase()); } catch (IllegalArgumentException ex) { style = BarStyle.SOLID; }
        bar = Bukkit.createBossBar("King", color, style);
        Bukkit.getPluginManager().registerEvents(this, this);
        for (Player player : Bukkit.getOnlinePlayers()) { bar.addPlayer(player); grantKingPermission(player); removeAttributes(player); }
        Player active = king == null ? null : Bukkit.getPlayer(king);
        if (phase.equals("RUNNING") && active != null && !active.isDead()) updateRoyalGuards(active);
        Bukkit.getScheduler().runTaskTimer(this, this::tick, 20L, 20L);
        Bukkit.getScheduler().runTaskTimer(this, this::aura, 1L, Math.max(1, getConfig().getLong("visuals.interval-ticks", 10)));
        getLogger().info("======================================");
        getLogger().info("       ULTIMATE KING SMP");
        getLogger().info("       Created by KazameKuroo");
        getLogger().info("======================================");
    }

    @Override
    public void onDisable() {
        if (king != null && Bukkit.getPlayer(king) != null && kingOfflineSince == 0) kingOfflineSince = System.currentTimeMillis();
        saveState();
        removeRoyalGuards();
        for (Player player : Bukkit.getOnlinePlayers()) removeAttributes(player);
        for (PermissionAttachment attachment : attachments.values()) attachment.remove();
        if (bar != null) bar.removeAll();
    }

    private String color(String text) { return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text); }
    private String message(String key) { return color(getConfig().getString("messages.prefix", "") + getConfig().getString("messages." + key, key)); }
    private String name(UUID id) { return id == null ? "None" : Bukkit.getOfflinePlayer(id).getName() == null ? id.toString() : Bukkit.getOfflinePlayer(id).getName(); }
    private UUID uuid(String value) { try { return value == null || value.isEmpty() ? null : UUID.fromString(value); } catch (IllegalArgumentException ex) { return null; } }
    private void readMap(String path, Map<UUID, Integer> map) {
        if (!data.isConfigurationSection(path)) return;
        for (String key : data.getConfigurationSection(path).getKeys(false)) { UUID id = uuid(key); if (id != null) map.put(id, data.getInt(path + "." + key)); }
    }
    private void loadState() {
        king = uuid(data.getString("king")); claimant = uuid(data.getString("claimant"));
        level = Math.max(1, Math.min(10, data.getInt("level", 1))); xp = data.getInt("xp"); deaths = data.getInt("deaths"); bounty = data.getInt("bounty");
        deadline = data.getLong("deadline"); nextBounty = data.getLong("next-bounty"); abilityReady = data.getLong("ability-ready");
        dashReady = data.getLong("powers.dash-ready"); freezeReady = data.getLong("powers.freeze-ready");
        for (int slot = 0; slot < 2; slot++) { long ready = data.getLong("royal-guards.respawn." + slot); if (ready > 0) royalGuardRespawns.put(slot, ready); }
        phase = data.getString("lifecycle.phase", data.contains("kills") || data.contains("king") ? "RUNNING" : "STOPPED");
        phaseDeadline = data.getLong("lifecycle.deadline"); kingOfflineSince = data.getLong("lifecycle.king-offline-since");
        diamonds = data.getInt("challenge.diamonds"); netherSeconds = data.getInt("challenge.nether"); apples = data.getInt("challenge.apples"); tamed = data.getBoolean("challenge.tamed");
        crownDropped = data.getBoolean("crown-dropped"); crownLocation = data.getLocation("crown-location");
        for (String value : data.getStringList("guards")) { UUID id = uuid(value); if (id != null) guards.add(id); }
        for (String value : data.getStringList("challenge.victims")) { UUID id = uuid(value); if (id != null) victims.add(id); }
        readMap("kills", kills); readMap("history", history); readMap("king-kills", kingKills); readMap("king-deaths", kingDeaths);
    }
    private List<String> strings(Set<UUID> ids) { List<String> result = new ArrayList<>(); for (UUID id : ids) result.add(id.toString()); return result; }
    private void writeMap(String path, Map<UUID, Integer> map) { data.set(path, null); for (Map.Entry<UUID, Integer> entry : map.entrySet()) data.set(path + "." + entry.getKey(), entry.getValue()); }
    private void saveState() {
        data.set("king", king == null ? null : king.toString()); data.set("claimant", claimant == null ? null : claimant.toString());
        data.set("level", level); data.set("xp", xp); data.set("deaths", deaths); data.set("bounty", bounty);
        data.set("deadline", deadline); data.set("next-bounty", nextBounty); data.set("ability-ready", abilityReady);
        data.set("powers.dash-ready", dashReady); data.set("powers.freeze-ready", freezeReady);
        data.set("royal-guards.respawn", null); for (Map.Entry<Integer, Long> entry : royalGuardRespawns.entrySet()) data.set("royal-guards.respawn." + entry.getKey(), entry.getValue());
        data.set("lifecycle.phase", phase); data.set("lifecycle.deadline", phaseDeadline); data.set("lifecycle.king-offline-since", kingOfflineSince);
        data.set("challenge.diamonds", diamonds); data.set("challenge.nether", netherSeconds); data.set("challenge.apples", apples); data.set("challenge.tamed", tamed); data.set("challenge.victims", strings(victims));
        data.set("guards", strings(guards)); data.set("crown-dropped", crownDropped); data.set("crown-location", crownLocation);
        writeMap("kills", kills); writeMap("history", history); writeMap("king-kills", kingKills); writeMap("king-deaths", kingDeaths);
        try { data.save(dataFile); } catch (IOException ex) { getLogger().warning("Could not save king data: " + ex.getMessage()); }
    }
    private void grantKingPermission(Player player) {
        PermissionAttachment old = attachments.remove(player.getUniqueId()); if (old != null) old.remove();
        if (player.getUniqueId().equals(king)) { PermissionAttachment a = player.addAttachment(this); a.setPermission("ultimatekingsamp.king", true); attachments.put(player.getUniqueId(), a); }
    }
    private void crown(Player player) {
        removeRoyalGuards(); royalGuardRespawns.clear();
        Player old = king == null ? null : Bukkit.getPlayer(king);
        if (old != null) { removeAttributes(old); king = null; grantKingPermission(old); }
        king = player.getUniqueId(); claimant = null; deadline = 0; crownDropped = false; crownLocation = null;
        kingOfflineSince = 0;
        level = 1; xp = 0; deaths = 0; bounty = 0; abilityReady = 0; dashReady = 0; freezeReady = 0; frozen.clear(); guards.clear(); victims.clear(); diamonds = 0; netherSeconds = 0; apples = 0; tamed = false;
        nextBounty = System.currentTimeMillis() + Math.max(1, getConfig().getLong("bounty.interval-seconds", 600)) * 1000L;
        history.put(king, history.getOrDefault(king, 0) + 1); grantKingPermission(player);
        if (phase.equals("RUNNING")) updateRoyalGuards(player);
        Bukkit.broadcastMessage(message("crowned").replace("%player%", player.getName()));
        for (Player online : Bukkit.getOnlinePlayers()) {
            online.sendTitle(color(getConfig().getString("messages.title", "&6A NEW KING")), color(getConfig().getString("messages.subtitle", "%player%").replace("%player%", player.getName())), 10, 80, 20);
            XSound.matchXSound(getConfig().getString("visuals.sound", "ENTITY_ENDER_DRAGON_GROWL")).ifPresent(s -> s.play(online));
        }
        Firework firework = player.getWorld().spawn(player.getLocation(), Firework.class);
        FireworkMeta meta = firework.getFireworkMeta(); meta.addEffect(org.bukkit.FireworkEffect.builder().withColor(org.bukkit.Color.YELLOW, org.bukkit.Color.ORANGE).with(org.bukkit.FireworkEffect.Type.BALL_LARGE).trail(true).build()); meta.setPower(0); firework.setFireworkMeta(meta);
        Bukkit.getScheduler().runTaskLater(this, firework::detonate, 2L);
        saveState();
    }
    private void addXp(int amount) {
        if (king == null || level >= 10) return;
        xp += Math.max(0, amount);
        int threshold = Math.max(1, getConfig().getInt("xp.per-level", 100));
        while (level < 10 && xp >= threshold * level) { xp -= threshold * level; level++; Bukkit.broadcastMessage(message("level-up").replace("%level%", String.valueOf(level))); }
        if (level == 10) xp = 0;
    }
    private void effect(Player p, String type, int seconds, int amplifier) {