thornvi

Kodari, make a plugin about 8 different soul abilities that can be activated by using right click and shift right click, make it so you can only have one equipped and make it drop on death, each soul needs 2 abilities and a permanant potion effect

Kodari AI
KodariOct 3 at 12:20 am 1
SoulboundAbilities
A Minecraft plugin introducing eight distinct soul abilities, each granting two active powers and a permanent potion effect. Players equip one soul at a time via right-click to activate the primary ability and shift right-click for the secondary. Souls drop on death, creating risk-reward gameplay. Includes cooldown management, configurable effects, and a GUI-free selection system using item interactions.

I’ll create the plugin setup, eight soul definitions with two right-click abilities and a permanent effect each, plus equip, pickup, cooldown, and death-drop handling.

Created the SoulAbilities plugin with eight souls, each providing two abilities—right-click and sneak + right-click—and a continuously refreshed permanent potion effect. Players can equip only one soul; the equipped soul drops on death and can be collected by another player.

Use /soul list to view the souls, /soul equip <soul> to equip one, and /soul give <player> <soul> to give one (admin permission).

thornvi

Make it so using commands i can randomize events for the souls and change crafting recipes

Kodari AI
KodariOct 3 at 12:27 am 1
  1. Add a command to randomize soul events/abilities.

  2. Add admin commands to change soul crafting recipes.

Added two admin commands requiring soul.admin:

  • /soul randomize randomly shuffles which abilities and permanent potion effects belong to each soul. The assignments persist across restarts.

  • /soul recipe <soul> <9 materials> sets that soul’s 3×3 crafting recipe. Enter ingredients top-left to bottom-right; use - for an empty slot. For example: /soul recipe ember - - - - NETHER_STAR - - - -.

  • /soul recipe <soul> reset removes that soul’s recipe.

Recipes are saved and restored after restart.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 683
src/main/java/com/kodari/souls/SoulAbilitiesPlugin.java
package com.kodari.souls;

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.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
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.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;

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

public final class SoulAbilitiesPlugin extends JavaPlugin implements Listener {
    private NamespacedKey soulKey;
    private final Map<UUID, Long> cooldowns = new HashMap<>();

    @Override
    public void onEnable() {
        soulKey = new NamespacedKey(this, "soul");
        getServer().getPluginManager().registerEvents(this, this);
        loadSoulRecipes();
        getServer().getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                applyPermanentEffect(player);
            }
        }, 0L, 100L);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0 || args[0].equalsIgnoreCase("list")) {
            sender.sendMessage(color("&6Souls: &eember, tide, gale, stone, life, shadow, storm, frost"));
            if (sender instanceof Player player) {
                Soul equipped = getEquipped(player);
                sender.sendMessage(color(equipped == null
                        ? "&7No soul equipped. Use &f/soul equip <name>&7."
                        : "&7Equipped: &f" + equipped.displayName + "&7. Right-click for ability 1; sneak + right-click for ability 2."));
            }
            return true;
        }

        if (args[0].equalsIgnoreCase("give")) {
            if (!sender.hasPermission("soul.admin")) {
                sender.sendMessage(color("&cYou do not have permission."));
                return true;
            }
            if (args.length < 3) {
                sender.sendMessage(color("&cUsage: /soul give <player> <soul>"));
                return true;
            }
            Player target = Bukkit.getPlayerExact(args[1]);
            Soul soul = Soul.fromName(args[2]);
            if (target == null || soul == null) {
                sender.sendMessage(color("&cPlayer not found or unknown soul. Use /soul list."));
                return true;
            }
            Map<Integer, ItemStack> leftovers = target.getInventory().addItem(createSoulItem(soul));
            leftovers.values().forEach(item -> target.getWorld().dropItemNaturally(target.getLocation(), item));
            target.sendMessage(color("&6You received the &e" + soul.displayName + " Soul&6. Right-click it to equip."));
            sender.sendMessage(color("&aGave " + soul.displayName + " Soul to " + target.getName() + '.'));
            return true;
        }

        if (args[0].equalsIgnoreCase("recipe")) {
            if (!sender.hasPermission("soul.admin")) {
                sender.sendMessage(color("&cYou do not have permission."));
                return true;
            }
            if (args.length < 3) {
                sender.sendMessage(color("&cUsage: /soul recipe <soul> <9 materials|reset>"));
                return true;
            }
            Soul soul = Soul.fromName(args[1]);
            if (soul == null) {
                sender.sendMessage(color("&cUnknown soul. Use /soul list."));
                return true;
            }
            String recipePath = "recipes." + soul.id;
            if (args.length == 3 && args[2].equalsIgnoreCase("reset")) {
                Bukkit.removeRecipe(soulRecipeKey(soul));
                getConfig().set(recipePath, null);
                saveConfig();
                sender.sendMessage(color("&aRemoved the crafting recipe for the &e" + soul.displayName + " Soul&a."));
                return true;
            }
            if (args.length != 11) {
                sender.sendMessage(color("&cUsage: /soul recipe <soul> <9 materials|->"));
                return true;
            }
            List<String> cells = new ArrayList<>();
            boolean hasIngredient = false;
            for (int i = 2; i < 11; i++) {
                if (args[i].equals("-")) {
                    cells.add("-");
                    continue;
                }
                Material material = XMaterial.matchXMaterial(args[i]).map(XMaterial::parseMaterial).orElse(null);
                if (material == null || material.isAir()) {
                    sender.sendMessage(color("&cInvalid recipe ingredient: " + args[i]));
                    return true;
                }
                cells.add(material.name());
                hasIngredient = true;
            }
            if (!hasIngredient) {
                sender.sendMessage(color("&cA recipe needs at least one ingredient."));
                return true;
            }
            if (!registerSoulRecipe(soul, cells)) {
                sender.sendMessage(color("&cCould not register that recipe."));
                return true;
            }
            getConfig().set(recipePath, cells);
            saveConfig();
            sender.sendMessage(color("&aUpdated the crafting recipe for the &e" + soul.displayName + " Soul&a."));
            return true;
        }

        if (args[0].equalsIgnoreCase("randomize")) {
            if (!sender.hasPermission("soul.admin")) {
                sender.sendMessage(color("&cYou do not have permission."));
                return true;
            }
            for (Player player : Bukkit.getOnlinePlayers()) {
                Soul equipped = getEquipped(player);
                if (equipped != null) {
                    removePermanentEffect(player, randomizedProfile(equipped));
                }
            }
            List<Soul> profiles = new ArrayList<>(List.of(Soul.values()));
            Collections.shuffle(profiles);
            Soul[] souls = Soul.values();
            for (int i = 0; i < souls.length; i++) {
                getConfig().set("randomized-profiles." + souls[i].id, profiles.get(i).id);
            }
            saveConfig();
            for (Player player : Bukkit.getOnlinePlayers()) {
                applyPermanentEffect(player);
                PlayerInventory inventory = player.getInventory();
                for (int slot = 0; slot < inventory.getSize(); slot++) {
                    Soul soul = getSoul(inventory.getItem(slot));
                    if (soul != null) {
                        inventory.setItem(slot, createSoulItem(soul));
                    }
                }
            }
            sender.sendMessage(color("&aRandomized the abilities and permanent effects assigned to all souls."));
            return true;
        }

        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used by a player.");
            return true;
        }
        if (!player.hasPermission("soul.use")) {
            player.sendMessage(color("&cYou do not have permission."));
            return true;
        }

        if (args[0].equalsIgnoreCase("equip")) {
            if (args.length < 2) {
                player.sendMessage(color("&cUsage: /soul equip <soul>"));
                return true;
            }
            Soul soul = Soul.fromName(args[1]);
            if (soul == null) {
                player.sendMessage(color("&cUnknown soul. Use /soul list."));
                return true;
            }
            equip(player, soul);
            player.sendMessage(color("&aEquipped the &e" + soul.displayName + " Soul&a. Its item activates your abilities."));
            return true;
        }