tcoad

/announce opens a INVENTORY GUI.

The player can enter their announcement text using a sign input INVENTORY GUI.

After entering the text, it asks which color style to use:

Red → Blue Bold Gradient from red to blue

Blue → Red Bold Gradient from blue to red

White → Purple Bold Gradient from white to purple After selecting a style, the announcement is broadcast to the server using the chosen gradient.

/dashsword — gives the player a DashSword.

Name: DashSword Name is bold.

Name has a red → purple gradient.

Crouch + right-click activates the dash.

Launches the player 60–90 blocks by default in the direction they're looking.

Supports:

Forward Backward Left Right Up Down /dashsword config — configure launch distance and cooldown.

DashSword has its own independent cooldown from DashMace.

/dashmace — gives the player a DashMace.

Name: DashMace Name is bold.

Name has a white → gray gradient.

Crouch + right-click launches the player.

Launch direction follows exactly where the player is looking:

Forward Backward Left Right Up Down Default launch distance: 60–90 blocks. /dashmace config — configure:

Launch distance Cooldown DashMace has its own independent cooldown from DashSword

Custom axe named CobWeb Axe Name is bold Name has a white → gray gradient.

Crouch + right-click activates its ability.

Removes all cobwebs within a 30-block radius of the player.

Default cooldown: 20 seconds. /cobaxe — gives the player a CobWeb Axe. /cobweb axe config — configure:

Cooldown Radius

The killstreak increases by 1 for every kill.

The killstreak resets/disappears when the player dies. /killstreak — shows the player's current killstreak. /killstreak config — allows admins to enable/disable the killstreak popups.

Killstreak Milestones

Milestones:

3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 100, 150, 200 kills

When a player reaches a milestone:

Only that player sees a large popup.

Example: 3 KILLSTREAK !

The text has a gradient red → blue → purple.

The player receives 5 KillTokens for every milestone reached.

The reward is given once per milestone per killstreak.

If they die and build a new streak, they can earn the milestones again.

/role create <role> — creates a new custom role. /role add <player> <role> — gives a player the specified role. /role remove <player> <role> — removes the role from a player. /role config — opens a INVENTORY GUI to configure roles:

Color of the role/name Boldness on/off Permissions — choose which Minecraft commands that role can use Add/remove commands from the role's permission list Roles should be saved permanently.

Players can have multiple roles.

Role formatting should apply to player names/chat where appropriate.

Make sure /role commands have appropriate admin permissions..

👑 Only players with the Owner/owner role can use /giveaway create. /giveaway create opens a INVENTORY GUI.

The Owner places the item to give away inside the INVENTORY GUI.

The Owner clicks Start.

A large screen popup appears with a white → red → white color animation.

Players enter by using /giveaway.

The giveaway lasts 24 hours.

After 24 hours, one random player who entered wins.

The winner receives the exact item that was placed in the giveaway INVENTORY GUI.

Announce the winner to the server. 🟦 Item: Nether Star 🏷️ Name: KillTokens 🎨 Name color: gradient/shade red → icy blue ⚔️ On kill: Player receives 1 KillToken 🧪 Replacement: If the player has a Strength II potion, the KillToken replaces that potion instead of adding another item. 📦 No Strength II potion: The KillToken is simply added to their inventory. 🔢 Amount can be configured later if needed.

Kodari AI
KodariAug 18 at 7:49 pm 4
UltimateKitPvP
UltimateKitPvP is a comprehensive Minecraft plugin suite featuring custom dash weapons (DashSword and DashMace) with configurable launch distances and cooldowns, a CobWeb Axe that clears cobwebs in a radius, a killstreak system with milestone rewards granting KillTokens, a permanent role management system with customizable colors and permissions, and an Owner-only giveaway system with 24-hour entries and random winner selection. All items feature gradient names and unique abilities activated by crouch-right-click.
  1. Create the Gradle Kotlin plugin project and Bukkit manifest/configuration.

  2. Implement announcements, dash items, cobweb axe, killstreaks, KillTokens, roles, and giveaway management.

  3. Register commands, GUIs, persistence, cooldowns, and event handlers in the main plugin.

Created KodariAbilities, a Kotlin Paper plugin with:

  • Gradient /announce GUI and announcement style selection.

  • /dashsword and /dashmace directional crouch-right-click abilities with independent cooldowns.

  • /cobaxe CobWeb Axe with configurable radius and cooldown.

  • Killstreak tracking, milestone popups, resets on death, and KillToken rewards.

  • Strength II potion replacement with KillTokens.

  • Persistent custom roles with colors, bold formatting, permissions, and admin management.

  • Owner-only /giveaway create, item setup GUI, 24-hour duration, random winner selection, and persistent storage.

  • Configurable settings in config.yml.

  • Kotlin Gradle build files, plugin.yml, and manifest.kod.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle.kts
manifest.kod
settings.gradle.kts
Code
8 630
src/main/kotlin/com/kodari/abilities/KodariPlugin.kt
package com.kodari.abilities

import net.kyori.adventure.text.Component
import net.kyori.adventure.text.event.ClickEvent
import net.kyori.adventure.text.format.TextColor
import org.bukkit.Bukkit
import org.bukkit.Material
import org.bukkit.NamespacedKey
import org.bukkit.entity.Player
import org.bukkit.event.EventHandler
import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
import org.bukkit.event.block.Action
import org.bukkit.event.entity.EntityDamageByEntityEvent
import org.bukkit.event.entity.PlayerDeathEvent
import org.bukkit.event.inventory.InventoryClickEvent
import org.bukkit.event.inventory.InventoryCloseEvent
import org.bukkit.event.player.AsyncPlayerChatEvent
import org.bukkit.event.player.PlayerInteractEvent
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.player.PlayerCommandPreprocessEvent
import org.bukkit.inventory.Inventory
import org.bukkit.inventory.ItemFlag
import org.bukkit.inventory.ItemStack
import org.bukkit.inventory.meta.PotionMeta
import org.bukkit.persistence.PersistentDataType
import org.bukkit.potion.PotionEffectType
import org.bukkit.scheduler.BukkitRunnable
import org.bukkit.util.Vector
import java.util.UUID
import java.util.concurrent.ConcurrentHashMap
import kotlin.math.floor

class KodariPlugin : org.bukkit.plugin.java.JavaPlugin(), Listener {
    lateinit var data: KodariData
        private set
    lateinit var itemKey: NamespacedKey
        private set
    private val cooldowns = ConcurrentHashMap<String, Long>()
    private val announcementInput = hashMapOf<UUID, String>()
    private val rolePermissionInput = hashMapOf<UUID, String>()

    override fun onEnable() {
        saveDefaultConfig()
        data = KodariData(this)
        itemKey = NamespacedKey(this, "kodari-item")
        server.pluginManager.registerEvents(this, this)
        object : BukkitRunnable() {
            override fun run() {
                if (data.giveawayActive && System.currentTimeMillis() >= data.giveawayEndsAt) finishGiveaway()
            }
        }.runTaskTimer(this, 20L, 20L * 20L)
    }

    override fun onDisable() {
        if (::data.isInitialized) data.save()
    }

    override fun onCommand(sender: org.bukkit.command.CommandSender, command: org.bukkit.command.Command, label: String, args: Array<out String>): Boolean {
        val player = sender as? Player ?: run { sender.sendMessage("Players only."); return true }
        when (command.name.lowercase()) {
            "announce" -> openAnnouncement(player)
            "dashsword" -> if (args.firstOrNull()?.equals("config", true) == true) openAbilityConfig(player, "sword") else giveItem(player, "dash-sword")
            "dashmace" -> if (args.firstOrNull()?.equals("config", true) == true) openAbilityConfig(player, "mace") else giveItem(player, "dash-mace")
            "cobaxe" -> giveItem(player, "cobweb-axe")
            "cobweb" -> if (args.firstOrNull()?.equals("axe", true) == true && args.getOrNull(1)?.equals("config", true) == true) openAbilityConfig(player, "axe") else player.sendMessage("Use /cobweb axe config.")
            "killstreak" -> if (args.firstOrNull()?.equals("config", true) == true) openKillstreakConfig(player) else player.sendMessage("Your killstreak is ${data.streaks[player.uniqueId] ?: 0}.")
            "role" -> roleCommand(player, args)
            "giveaway" -> giveawayCommand(player, args)
        }
        return true
    }

    private fun roleCommand(player: Player, args: Array<out String>) {
        if (args.firstOrNull()?.equals("config", true) == true) { if (isAdmin(player)) openRoleConfig(player) else deny(player); return }
        if (!isAdmin(player)) { deny(player); return }
        when (args.firstOrNull()?.lowercase()) {
            "create" -> {
                val name = args.getOrNull(1) ?: run { player.sendMessage("Usage: /role create <role>"); return }
                if (data.roles.keys.any { it.equals(name, true) }) player.sendMessage("That role already exists.")
                else { data.roles[name] = KodariRole(name); data.save(); player.sendMessage("Created role $name.") }
            }
            "add" -> changeRole(player, args, true)
            "remove" -> changeRole(player, args, false)
            else -> player.sendMessage("Usage: /role create|add|remove|config")
        }
    }

    private fun changeRole(actor: Player, args: Array<out String>, add: Boolean) {
        val target = args.getOrNull(1)?.let { Bukkit.getPlayerExact(it) }
        val role = args.getOrNull(2)?.let { data.roles.values.firstOrNull { r -> r.name.equals(it, true) } }
        if (target == null || role == null) { actor.sendMessage("Usage: /role ${if (add) "add" else "remove"} <player> <role>"); return }
        if (add) data.addRole(target, role) else data.removeRole(target, role.name)
        actor.sendMessage("${if (add) "Added" else "Removed"} ${role.name} ${if (add) "to" else "from"} ${target.name}.")
    }

    private fun giveawayCommand(player: Player, args: Array<out String>) {
        if (args.firstOrNull()?.equals("create", true) == true) {
            if (!data.hasRole(player, "Owner")) { player.sendMessage("Only the Owner role can create giveaways."); return }
            if (data.giveawayActive) { player.sendMessage("A giveaway is already active."); return }
            openGiveaway(player)
        } else if (data.giveawayActive) {
            data.entrants += player.uniqueId
            data.save()
            player.sendMessage("You entered the giveaway. Good luck!")
        } else player.sendMessage("There is no active giveaway.")
    }

    private fun isAdmin(player: Player) = player.hasPermission("kodari.role.admin") || player.isOp
    private fun deny(player: Player) = player.sendMessage("You do not have permission.")

    private fun namedItem(material: Material, name: Component, type: String): ItemStack {
        val item = ItemStack(material)
        val meta = item.itemMeta
        meta.displayName(name)
        meta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES)
        meta.persistentDataContainer.set(itemKey, PersistentDataType.STRING, type)
        item.itemMeta = meta
        return item
    }

    private fun giveItem(player: Player, type: String) {
        val item = when (type) {
            "dash-sword" -> namedItem(Material.NETHERITE_SWORD, Gradient.text("DashSword", intArrayOf(255, 30, 30), intArrayOf(175, 40, 255), true), type)
            "dash-mace" -> namedItem(Material.MACE, Gradient.text("DashMace", intArrayOf(255, 255, 255), intArrayOf(125, 125, 125), true), type)
            else -> namedItem(Material.NETHERITE_AXE, Gradient.text("CobWeb Axe", intArrayOf(255, 255, 255), intArrayOf(125, 125, 125), true), type)
        }
        player.inventory.addItem(item).values.forEach { player.world.dropItemNaturally(player.location, it) }
        player.sendMessage("You received a ${item.itemMeta?.displayName()?.let { "special item" } ?: "special item"}.")
    }

    private fun itemType(item: ItemStack?): String? = item?.itemMeta?.persistentDataContainer?.get(itemKey, PersistentDataType.STRING)

    @EventHandler
    fun onInteract(event: PlayerInteractEvent) {
        if (event.action != Action.RIGHT_CLICK_AIR && event.action != Action.RIGHT_CLICK_BLOCK) return
        if (!event.player.isSneaking) return
        when (itemType(event.item)) {
            "dash-sword" -> { event.isCancelled = true; dash(event.player, "sword") }
            "dash-mace" -> { event.isCancelled = true; dash(event.player, "mace") }
            "cobweb-axe" -> { event.isCancelled = true; clearCobwebs(event.player) }
        }
    }

    private fun dash(player: Player, kind: String) {
        val path = if (kind == "sword") "dash-sword" else "dash-mace"
        val key = "${player.uniqueId}:$kind"
        val now = System.currentTimeMillis()
        val cooldown = config.getLong("$path.cooldown-seconds") * 1000L
        val remaining = (cooldowns.getOrDefault(key, 0L) - now).coerceAtLeast(0L)
        if (remaining > 0) { player.sendMessage("Ability cooldown: ${((remaining + 999) / 1000)}s."); return }
        cooldowns[key] = now + cooldown
        val distance = config.getDouble("$path.distance", 75.0)
        player.velocity = player.eyeLocation.direction.normalize().multiply(distance / 10.0)
    }

    private fun clearCobwebs(player: Player) {
        val key = "${player.uniqueId}:axe"
        val now = System.currentTimeMillis()
        val cooldown = config.getLong("cobweb-axe.cooldown-seconds") * 1000L
        val remaining = (cooldowns.getOrDefault(key, 0L) - now).coerceAtLeast(0L)
        if (remaining > 0) { player.sendMessage("Ability cooldown: ${((remaining + 999) / 1000)}s."); return }
        cooldowns[key] = now + cooldown
        val radius = config.getInt("cobweb-axe.radius", 30)
        val world = player.world
        val center = player.location
        var removed = 0
        for (x in floor(center.x - radius).toInt()..floor(center.x + radius).toInt()) for (y in (center.blockY - radius).coerceAtLeast(world.minHeight)..(center.blockY + radius).coerceAtMost(world.maxHeight - 1)) for (z in floor(center.z - radius).toInt()..floor(center.z + radius).toInt()) {
            val location = org.bukkit.Location(world, x.toDouble(), y.toDouble(), z.toDouble())
            if (location.distanceSquared(center) <= radius * radius && world.getBlockAt(x, y, z).type == Material.COBWEB) { world.getBlockAt(x, y, z).type = Material.AIR; removed++ }
        }
        player.sendMessage("Removed $removed cobwebs.")
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    fun onKill(event: EntityDamageByEntityEvent) {
        val victim = event.entity as? Player ?: return
        val killer = event.damager as? Player ?: return
        if (victim.health - event.finalDamage > 0) return
        val streak = (data.streaks[killer.uniqueId] ?: 0) + 1
        data.streaks[killer.uniqueId] = streak
        giveKillToken(killer)
        val milestones = config.getIntegerList("killstreak.milestones")
        if (streak in milestones && data.milestoneSet(killer.uniqueId).add(streak)) {
            val amount = config.getInt("killstreak.token-amount", 1)
            repeat((amount - 1).coerceAtLeast(0)) { giveKillToken(killer) }
            if (config.getBoolean("killstreak.popups", true)) killer.showTitle(net.kyori.adventure.title.Title.title(Gradient.text("$streak KILLSTREAK !", intArrayOf(255, 30, 30), intArrayOf(170, 30, 255), true), Component.text("")))
            Bukkit.broadcast(Gradient.text("${killer.name} reached a $streak killstreak!", intArrayOf(255, 30, 30), intArrayOf(170, 30, 255)))
        }
        data.save()
    }

    private fun giveKillToken(player: Player) {
        val token = namedItem(Material.NETHER_STAR, Gradient.text("KillTokens", intArrayOf(255, 40, 40), intArrayOf(150, 235, 255), true), "kill-token")
        val potionSlot = player.inventory.contents.indexOfFirst { stack ->
            stack?.type == Material.POTION && (stack.itemMeta as? PotionMeta)?.customEffects?.any { it.type == PotionEffectType.STRENGTH && it.amplifier >= 1 } == true
        }
        if (potionSlot >= 0) player.inventory.setItem(potionSlot, token) else player.inventory.addItem(token).values.forEach { player.world.dropItemNaturally(player.location, it) }
    }