BLAZE GAMER

Bro can you make a texture pack for this plugin which contains some type of sword every sword have its unique ability you can analyse the plugin and decide with shorts should be look like how

Kodari AI
KodariOct 9 at 1:53 pm 1
  1. Analyze the plugin’s current weapons and abilities to choose matching sword designs.

  2. Texture generation is disabled here; enable it in project Settings → Generation so I can create the pack assets.This project is currently just a DemonBlade plugin descriptor—there’s no sword or ability code yet, so I can’t match designs to existing mechanics. A fitting starting theme would be elemental demon swords: Flame (burning slash), Tide (water burst), Thunder (quick dash), and Shadow (short blink). Those abilities would need to be implemented in the plugin; textures alone won’t add them.

Texture generation is disabled for this project. Enable it via Settings → Generation, and I can create the sword textures.

BLAZE GAMER

Can you show me how the textures are looking like

Kodari AI
KodariOct 9 at 1:54 pm 1

I can’t render a texture preview while generation is disabled. The sword concepts could look like this:

  • Flame: black blade with glowing orange cracks and a ember-red edge.

  • Tide: deep-blue blade with pale aqua waves running through it.

  • Thunder: gold-and-violet blade with a sharp lightning-shaped stripe.

  • Shadow: near-black blade with a violet edge and a small glowing eye in the guard.

Enable texture generation in Settings → Generation, and I can create the textures.

BLAZE GAMER

Make it compile able

Kodari AI
KodariOct 9 at 1:56 pm 1
  • Check the project’s build setup and plugin entry points.

  • Fix the minimum missing or invalid files needed for compilation.

  • Leave the project ready to compile in Kodari.

Added a Gradle build setup and the WelcomePlugin entry point, and moved plugin.yml into Gradle’s resources folder so it’s included in the plugin JAR. This is a compileable plugin skeleton; it doesn’t add swords, abilities, or textures.

BLAZE GAMER

Bro I just ask you to make a new resource pack for this plugins item s

Kodari AI
KodariOct 9 at 1:57 pm 1

You’re right—I misunderstood. You want a resource pack for the plugin’s sword items, not compile fixes.

Texture generation is disabled for this project. Enable it in Settings → Generation, and I can create the pack. I’ll also need the plugin’s sword items or their names so the textures match them.

BLAZE GAMER

I have enable it

Kodari AI
KodariOct 9 at 1:59 pm 1

Thanks. I checked the project: it currently has no sword items or abilities—just an empty plugin entry point—so there aren’t any existing item textures to match.

Since you asked me to choose the designs, I can use a Flame, Tide, Thunder, and Shadow sword set. The plugin will need those items defined before a resource pack can target them. Do you want me to add the swords to the plugin too?

BLAZE GAMER

Is the swords are not defined

Kodari AI
KodariOct 9 at 2:00 pm 1

Correct—the current plugin is only a compileable skeleton. It doesn’t define any swords or custom item IDs yet, so there’s nothing for a resource pack to target. The swords need to be added to the plugin first; then their textures can be matched to those items.

BLAZE GAMER

So add it. And also check that the ability function and cool down and level up function should I be disturbed by it

Kodari AI
KodariOct 9 at 2:04 pm 2
  1. Add the sword items and a way for players to obtain them.

  2. Implement each sword’s ability with cooldown feedback.

  3. Add persistent per-sword leveling and connect it to gameplay events.

Added four swords, each with a working right-click ability:

  • Flamefang: burns and damages nearby enemies.

  • Tidecaller: heals you and puts out fire.

  • Stormsplitter: launches you forward.

  • Nightfall: blinks forward to the nearest clear spot.

Use /swords to receive them. Hits and kills grant XP; each sword levels up to 10, strengthening its ability and reducing its cooldown. Progress is saved in config.yml.

I also assigned model IDs 2101–2104 for matching resource-pack models. The plugin items and abilities are implemented; texture artwork and pack model files aren’t included in this code change.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 318
src/main/java/com/kodari/welcome/WelcomePlugin.java
package com.kodari.welcome;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
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.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public final class WelcomePlugin extends JavaPlugin implements Listener, CommandExecutor {
    private static final int MAX_LEVEL = 10;
    private static final long SAVE_INTERVAL_TICKS = 1200L;

    private final Map<UUID, Map<Blade, Long>> cooldowns = new HashMap<>();
    private NamespacedKey bladeKey;

    @Override
    public void onEnable() {
        bladeKey = new NamespacedKey(this, "blade");
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("swords").setExecutor(this);
        Bukkit.getScheduler().runTaskTimer(this, this::saveConfig, SAVE_INTERVAL_TICKS, SAVE_INTERVAL_TICKS);
    }

    @Override
    public void onDisable() {
        saveConfig();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }

        for (Blade blade : Blade.values()) {
            ItemStack sword = createSword(player, blade);
            Map<Integer, ItemStack> leftovers = player.getInventory().addItem(sword);
            leftovers.values().forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
        }
        player.sendMessage(ChatColor.GREEN + "You received the four unique swords. Right-click to use an ability.");
        return true;
    }

    @EventHandler
    public void onSwordUse(PlayerInteractEvent event) {
        if (event.getHand() != EquipmentSlot.HAND
                || (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)) {
            return;
        }

        Player player = event.getPlayer();
        Blade blade = getBlade(player.getInventory().getItemInMainHand());
        if (blade == null) {
            return;
        }
        event.setCancelled(true);

        long now = System.currentTimeMillis();
        long readyAt = cooldowns.getOrDefault(player.getUniqueId(), Map.of()).getOrDefault(blade, 0L);
        if (readyAt > now) {
            player.sendMessage(ChatColor.GRAY + blade.displayName + " ready in "
                    + String.format("%.1f", (readyAt - now) / 1000.0) + "s.");
            return;
        }

        int level = getLevel(player.getUniqueId(), blade);
        if (!useAbility(player, blade, level)) {
            player.sendMessage(ChatColor.RED + "There isn't enough clear space to use that ability.");
            return;
        }

        long cooldownMillis = getCooldownSeconds(blade, level) * 1000L;
        cooldowns.computeIfAbsent(player.getUniqueId(), ignored -> new HashMap<>())
                .put(blade, now + cooldownMillis);
        player.sendMessage(ChatColor.GRAY + blade.abilityName + " used. Cooldown: "
                + (cooldownMillis / 1000) + "s.");
    }

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onSwordHit(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player player)
                || !(event.getEntity() instanceof LivingEntity target)) {
            return;
        }

        Blade blade = getBlade(player.getInventory().getItemInMainHand());
        if (blade == null) {
            return;
        }

        int gained = event.getFinalDamage() >= target.getHealth() ? 5 : 1;
        addExperience(player, blade, gained);
    }

    private ItemStack createSword(Player player, Blade blade) {
        ItemStack sword = XMaterial.matchXMaterial("DIAMOND_SWORD")
                .map(XMaterial::parseItem)
                .orElseThrow(() -> new IllegalStateException("DIAMOND_SWORD is unavailable"));
        ItemMeta meta = sword.getItemMeta();
        meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', blade.displayName));
        meta.setCustomModelData(blade.modelData);
        meta.setUnbreakable(true);
        meta.getPersistentDataContainer().set(bladeKey, PersistentDataType.STRING, blade.key);
        sword.setItemMeta(meta);
        updateSwordLore(player.getUniqueId(), blade, sword);
        return sword;
    }

    private Blade getBlade(ItemStack item) {
        if (item == null || !item.hasItemMeta()) {
            return null;
        }
        String key = item.getItemMeta().getPersistentDataContainer().get(bladeKey, PersistentDataType.STRING);
        return Blade.fromKey(key);
    }

    private boolean useAbility(Player player, Blade blade, int level) {
        switch (blade) {
            case FLAME -> {
                for (Entity entity : player.getNearbyEntities(4.0, 3.0, 4.0)) {
                    if (entity instanceof LivingEntity target && target != player) {
                        target.setFireTicks(Math.max(target.getFireTicks(), 80 + level * 20));
                        target.damage(3.0 + level * 0.5, player);
                    }
                }
            }
            case TIDE -> {
                player.setFireTicks(0);
                player.setHealth(Math.min(player.getMaxHealth(), player.getHealth() + 4.0 + level * 0.4));
            }
            case THUNDER -> {
                Vector velocity = player.getLocation().getDirection().normalize().multiply(1.15 + level * 0.1);
                velocity.setY(Math.max(velocity.getY(), 0.28));
                player.setVelocity(velocity);
            }
            case SHADOW -> {
                Location origin = player.getLocation();
                Vector direction = origin.getDirection().normalize();
                double distance = 4.5 + level * 0.35;
                for (double step = distance; step >= 1.0; step -= 0.5) {
                    Location destination = origin.clone().add(direction.clone().multiply(step));
                    if (destination.getBlock().isPassable()
                            && destination.clone().add(0, 1, 0).getBlock().isPassable()) {
                        return player.teleport(destination);
                    }
                }
                return false;
            }
        }
        return true;
    }

    private void addExperience(Player player, Blade blade, int amount) {
        UUID uuid = player.getUniqueId();
        int oldLevel = getLevel(uuid, blade);
        String path = progressPath(uuid, blade);
        int oldExperience = getConfig().getInt(path + ".xp", 0);
        if (oldLevel >= MAX_LEVEL) {
            return;
        }

        int newExperience = oldExperience + amount;
        int newLevel = levelFor(newExperience);
        getConfig().set(path + ".xp", newExperience);
        updateHeldSwords(player, blade);
        if (newLevel > oldLevel) {
            player.sendMessage(ChatColor.GOLD + blade.displayName + " reached level " + newLevel + "!");
        }
    }

    private int getLevel(UUID uuid, Blade blade) {
        return levelFor(getConfig().getInt(progressPath(uuid, blade) + ".xp", 0));
    }

    private int levelFor(int experience) {
        int level = 1;