rk_gaming0694

PROJECT: ANIMEPOWERS ULTIMATE — COMPLETE MINECRAFT PLUGIN

Act as a senior Minecraft Java developer, Paper API expert, gameplay designer, software architect, security engineer, and automated testing engineer.

Build a complete, modular, professional Minecraft Java plugin named AnimePowers Ultimate. This must be a real, compilable plugin project, not merely a design document or a collection of incomplete code snippets.

The plugin must combine anime-inspired characters, unique superpowers, custom weapons, bosses, transformations, progression, GUI menus, quests, rewards, administrator controls, and persistent player data.

  1. EXACT SERVER TARGET

Primary target:

  • Minecraft Java Edition.
  • Paper server.
  • Java programming language.
  • Maven project structure.
  • Intended server version: Paper 26.1.2, only if this exact version and its required Java toolchain are available and compatible.
  • If the requested Paper API version is unavailable, clearly explain the problem and ask before silently targeting another version.
  • Use genuine Bukkit/Paper APIs and documented dependencies.
  • Do not use Fabric-only APIs in this Paper plugin.
  • Do not assume that an API exists without checking its availability.
  • Include the complete project source code.
  1. PROJECT SIZE AND COMPLETENESS

Create a large project with the following goals:

  • At least 50 distinct playable characters.
  • At least 50 unique custom weapons.
  • At least 100 distinct abilities.
  • At least 10 unique bosses.
  • At least 10 rarity tiers or configurable rarity levels.
  • Multiple transformation stages.
  • Character progression, quests, achievements, skill trees, and rewards.
  • Multiple GUI menus.
  • Complete administrator and owner controls.
  • Persistent player profiles and configurable gameplay rules.

These numbers are content goals, not permission to create duplicate abilities or fake features. If implementation size becomes too large, build the project in manageable modules and complete every module.

Every listed feature must have a working implementation before it is described as complete.

  1. CHARACTER SYSTEM

Implement a character framework supporting:

  • Common, Uncommon, Rare, Epic, Legendary, Mythic, Divine, Ancient, Secret, and Supreme rarities.
  • Unique character IDs.
  • Character names, descriptions, rarity, lore, unlock conditions, base stats, weapons, abilities, and ultimate attacks.
  • Character selection GUI.
  • Character preview and detailed information screens.
  • Character ownership and unlock tracking.
  • Configurable character abilities and statistics.
  • Character evolution and awakening.
  • Leveling and experience.
  • Skill points and upgradeable skills.
  • Character-specific passive abilities.
  • Character-specific active abilities.
  • Character-specific ultimate abilities.
  • Transformation animations and effects.
  • Character-specific sounds and particles.
  • Configurable cooldowns and resource costs.
  • Saving and restoring each player's character selection.

Each character must have genuinely distinct gameplay behavior. Do not simply rename the same ability for different characters.

Create a modular registration system so new characters can be added without rewriting the entire plugin.

  1. CUSTOM WEAPON SYSTEM

Create a custom weapon framework containing at least 50 weapon definitions.

Weapon categories:

  • Swords.
  • Greatswords.
  • Daggers.
  • Scythes.
  • Spears.
  • Bows.
  • Crossbows.
  • Staffs.
  • Magical books.
  • Axes.
  • Elemental weapons.
  • Legendary weapons.
  • Boss-exclusive weapons.

Each weapon should support:

  • Unique internal ID.
  • Display name and colored name.
  • Configurable lore.
  • Custom damage and attack behavior.
  • Rarity.
  • Durability or configurable unbreakable behavior.
  • Passive effects.
  • Active skills.
  • Ability cooldowns.
  • Special attack animations using particles and sounds.
  • Unlock requirements.
  • Weapon evolution and upgrades.
  • Ownership restrictions if enabled.
  • Safe identification using persistent item data.
  • Protection against accidental duplication and forged item names.

Use supported Minecraft item components and Paper APIs where applicable. Do not rely only on item names or lore to identify powerful weapons.

  1. ABILITY AND POWER ENGINE

Implement a reusable ability engine.

Support:

  • Fire.
  • Water.
  • Ice.
  • Lightning.
  • Wind.
  • Earth.
  • Shadow.
  • Light.
  • Darkness.
  • Time-themed effects within feasible Minecraft gameplay limits.
  • Teleportation.
  • Dash attacks.
  • Shield abilities.
  • Healing.
  • Summoning.
  • Projectile attacks.
  • Area attacks.
  • Defensive abilities.
  • Passive abilities.
  • Ultimate attacks.
  • Transformations.
  • Crowd-control effects.

Each ability must define:

  • Unique ID.
  • Name and description.
  • Trigger method.
  • Cooldown.
  • Range.
  • Damage or healing.
  • Resource cost.
  • Targeting rules.
  • Particle effects.
  • Sounds.
  • Permissions.
  • Valid target restrictions.
  • Configuration settings.

Implement cooldown management, configurable damage scaling, safe targeting, world restrictions, PvP rules, and exploit prevention.

Never allow abilities to bypass server protections or create unlimited entities.

  1. CHARACTER LOCK SYSTEM

This is a critical requirement.

Players must not be able to freely switch their assigned character or powers after selection if character locking is enabled.

Implement:

  • First-time character selection.
  • Character lock after selection.
  • Owner-only and administrator-only reassignment.
  • Optional configurable permission for exceptional staff roles.
  • Persistent character assignment after logout and restart.
  • Clear messages when a player attempts an unauthorized switch.
  • Audit logging for staff character changes.
  • Configurable reset or unlock procedures.
  • Safe handling of offline players.

Normal players must not be able to use commands, GUIs, packets, item exploits, or alternate command paths to bypass character restrictions.

Do not grant every administrator unrestricted access automatically if the server owner has configured a more restrictive permission system.

  1. OWNER AND ADMIN CONTROLS

Create permissions:

  • animepowers.use
  • animepowers.character.select
  • animepowers.admin
  • animepowers.owner
  • animepowers.reload
  • animepowers.give
  • animepowers.setcharacter
  • animepowers.unlock
  • animepowers.boss.spawn
  • animepowers.debug

Commands:

  • /anime
  • /anime help
  • /anime menu
  • /anime character
  • /anime character info <id>
  • /anime choose <id>
  • /anime powers
  • /anime weapon
  • /anime stats
  • /anime skills
  • /anime quests
  • /anime profile
  • /anime boss list
  • /anime admin
  • /anime admin setcharacter <player> <id>
  • /anime admin unlock <player>
  • /anime admin giveweapon <player> <weapon>
  • /anime admin givecharacter <player> <character>
  • /anime admin spawnboss <boss>
  • /anime reload
  • /anime debug

Implement proper tab completion, argument validation, permission checks, usage messages, player-versus-console restrictions, and configurable command aliases.

Do not implement a command in documentation unless it actually exists in the source code.

  1. GUI MENU SYSTEM

Build professional, configurable inventory menus.

Required menus:

  • Main menu.
  • Character selection.
  • Character details.
  • Character collection.
  • Powers and abilities.
  • Weapon collection.
  • Weapon details.
  • Character statistics.
  • Skill tree.
  • Transformations.
  • Quests.
  • Daily rewards.
  • Boss information.
  • Administrator panel.
  • Confirmation screens.

GUI features:

  • Configurable titles and slot positions.
  • Configurable materials and icons.
  • Custom names and lore.
  • Pagination.
  • Next and previous page buttons.
  • Back and close buttons.
  • Search and filtering where practical.
  • Rarity-based presentation.
  • Permission-aware options.
  • Click validation.
  • Protection against moving or stealing menu items.
  • Safe handling of shift-clicks, drags, double-clicks, and inventory closure.
  • No accidental item duplication.

Use genuine inventory APIs and maintain a clean separation between menus and gameplay logic.

  1. BOSSES AND COMBAT

Implement at least 10 unique bosses with:

  • Unique names and descriptions.
  • Configurable health.
  • Configurable damage.
  • Boss bars.
  • Multiple combat phases.
  • Special attacks.
  • Summoned minions where appropriate.
  • Phase transitions.
  • Distinct particles and sounds.
  • Configurable spawn conditions.
  • Cooldowns and attack telegraphs.
  • Loot tables.
  • Rare weapon drops.
  • Experience and rewards.
  • Despawn and cleanup handling.
  • World and region restrictions.
  • Anti-farming controls.

Boss behavior must use supported entity AI or custom event-driven logic. Do not claim to provide custom animated 3D models unless the required resource pack or external model integration is included.

  1. QUESTS AND PROGRESSION

Implement:

  • Daily quests.
  • Repeatable quests.
  • Boss-kill quests.
  • Combat quests.
  • Weapon mastery.
  • Character mastery.
  • Experience and levels.
  • Skill points.
  • Achievements.
  • Unlockable abilities.
  • Configurable rewards.
  • Quest progress tracking.
  • Reward claim protection.
  • Persistent quest state.
  • Reset schedules configurable by the server owner.

Prevent repeated reward claims, duplicate event counting, and reward exploitation.

  1. PLAYER DATA AND STORAGE

Use a reliable storage layer.

Required player data:

  • UUID.
  • Selected character.
  • Character lock status.
  • Character level and experience.
  • Unlocked characters.
  • Unlocked weapons.
  • Ability upgrades.
  • Skill points.
  • Quest progress.
  • Boss statistics.
  • Cooldown data when appropriate.
  • Settings and preferences.

Requirements:

  • SQLite by default or another supported persistent storage implementation.
  • Safe database connections.
  • Prepared statements.
  • Database migrations where necessary.
  • Correct asynchronous database handling.
  • No unsafe Bukkit API calls from asynchronous threads.
  • Graceful recovery from missing or corrupted data.
  • Save data on relevant events and orderly shutdown.
  • Never lose a player's assigned character after a normal server restart.

Do not store important persistent data exclusively in memory.

  1. CONFIGURATION FILES

Provide complete example files:

  • plugin.yml
  • config.yml
  • messages.yml
  • characters.yml
  • weapons.yml
  • abilities.yml
  • bosses.yml
  • quests.yml
  • gui.yml
  • rewards.yml
  • permissions.yml, if required
  • pom.xml
  • README.md

Configuration should control:

  • Enabled features.
  • Damage multipliers.
  • Cooldowns.
  • Resource costs.
  • Character restrictions.
  • Weapon restrictions.
  • PvP behavior.
  • World restrictions.
  • Boss settings.
  • GUI appearance.
  • Messages.
  • Rewards.
  • Logging.
  • Storage.
  • Performance safeguards.

Validate configuration values and provide helpful warnings for invalid settings.

  1. VISUAL EFFECTS AND AUDIO

Use Minecraft's supported particle and sound APIs for:

  • Weapon swings.
  • Fire attacks.
  • Lightning attacks.
  • Ice effects.
  • Shadow abilities.
  • Teleportation.
  • Ultimate attacks.
  • Boss phase changes.
  • Character transformations.
  • Rare item discoveries.

Keep effects configurable and avoid excessive particle counts or sound spam.

Do not use nonexistent sound names, unsupported particles, or unsafe client-side assumptions.

  1. SKINS AND APPEARANCE

Implement the parts supported by Paper:

  • Character-specific armor or cosmetic equipment.
  • Custom item textures through a supplied resource pack where appropriate.
  • Configurable visual effects.
  • Optional integration points for external skin or model plugins.

Do not claim that a normal Paper plugin can automatically give every player a completely custom player skin without the necessary supported skin system or external integration.

Clearly document any optional dependencies.

  1. SECURITY AND ANTI-EXPLOIT

Implement:

  • Strict permission checks.
  • Command validation.
  • Safe item identification.
  • Cooldown enforcement.
  • Rate limits.
  • Duplicate reward prevention.
  • Protection against GUI item exploits.
  • Protection against forged custom weapons.
  • Safe handling of null or offline players.
  • Entity and projectile cleanup.
  • Limits on summoned entities.
  • Configurable combat restrictions.
  • Proper error handling.
  • No arbitrary command execution from player input.
  • No hidden operator privilege grants.
  • No external data collection.
  • No obfuscated or malicious code.

Log significant administrator actions without logging passwords or secrets.

  1. PERFORMANCE

Optimize for small and medium Paper servers.

Requirements:

  • Avoid unnecessary repeating tasks.
  • Avoid scanning every entity on every tick.
  • Use event-driven processing where appropriate.
  • Limit particle and entity creation.
  • Cancel tasks when players disconnect or bosses despawn.
  • Prevent memory leaks.
  • Clean up listeners, tasks, and temporary data.
  • Use asynchronous file or database work where safe.
  • Never access non-thread-safe Bukkit APIs asynchronously.
  • Keep the code modular and maintainable.
  1. SOURCE CODE STRUCTURE

Create a professional Maven project similar to:

AnimePowers/ pom.xml README.md src/main/java/ .../AnimePowersPlugin.java .../command/ .../character/ .../weapon/ .../ability/ .../boss/ .../gui/ .../quest/ .../storage/ .../listener/ .../config/ .../util/ src/main/resources/ plugin.yml config.yml messages.yml characters.yml weapons.yml abilities.yml bosses.yml quests.yml gui.yml rewards.yml src/test/java/ .../

Adjust package names and modules as appropriate. Every referenced class must exist, and all imports, method signatures, commands, permissions, and dependencies must match.

  1. BUILD AND TEST REQUIREMENTS

Generate:

  • Every required source file.
  • Every configuration file.
  • The complete Maven build configuration.
  • Test code where practical.
  • A README with setup and troubleshooting instructions.

Build command:

mvn clean package

Expected deliverable:

target/AnimePowers.jar

If the environment has Java, Maven, and compatible dependencies, actually run the build and fix compiler errors before claiming success.

If compilation cannot be performed in the current environment, state that honestly and provide the exact build steps. Never invent a successful build or a downloadable file that was not created.

  1. ANDROID-FRIENDLY INSTALLATION GUIDE

Explain step by step:

  1. How to download the generated source project.
  2. How to extract a ZIP project on Android.
  3. How to open or build the Maven project using a compatible Java development environment.
  4. How to obtain the final JAR.
  5. How to upload the JAR to a Paper server.
  6. How to install optional resource packs.
  7. How to restart the server.
  8. How to verify plugin loading in the console.
  9. How to configure permissions.
  10. How to test character selection and abilities.
  11. How to back up the world and player data.
  12. How to diagnose common errors.

Do not assume that Android itself automatically supports compiling a modern Paper plugin.

  1. RESPONSE AND FILE GENERATION RULES

Start by explaining the project architecture and checking version compatibility.

Then generate the actual project files.

If the complete project exceeds one response:

  • Divide it into clearly numbered parts.
  • Maintain a checklist of completed files.
  • Keep package names and APIs consistent across parts.
  • Do not omit files that were referenced earlier.
  • Continue from the last incomplete file.
  • Do not restart the entire project unnecessarily.
  • Never replace a requested complete implementation with pseudocode or a summary.

Prioritize a working, testable foundation before expanding content to all requested characters, weapons, abilities, and bosses.

At completion, provide a manifest of included files, build status, known limitations, installation instructions, and the final JAR only if the build environment actually created it.

FINAL OBJECTIVE: Deliver a complete and maintainable AnimePowers Ultimate Minecraft Paper plugin with fully implemented features, secure owner/admin controls, persistent player data, unique characters, unique weapons, abilities, bosses, quests, GUI menus, configuration files, and a reproducible build process.

Kodari AI
KodariOct 11 at 12:25 pm 1
  1. Check the existing project and whether Paper 26.1.2 is configured or available here.

  2. Establish a compilable core: plugin bootstrap, persistent profiles, character/weapon/ability registries, commands, and protected GUI flow.

  3. Add gameplay modules and configuration in focused stages, only claiming features that are implemented.

  4. Report the project manifest and verified build status.

Proposed architecture: a Maven Paper plugin split into bootstrap/configuration, SQLite-backed player profiles, character/weapon/ability registries, combat and bosses, progression and quests, commands/admin controls, and protected inventory GUIs.

Version check: the existing pom.xml targets Paper 1.21.4-R0.1-SNAPSHOT with Java 21. The Paper Maven repository returned 404 for 26.1.2-R0.1-SNAPSHOT, so I can’t confirm that requested API version is available. I’ll pause before changing the target: should I proceed with the project’s existing Paper 1.21.4 target, or do you want to specify another available Paper version?

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README-URDU.txt
Code
5 359
src/main/java/com/animesmp/AnimeSMPPlugin.java
package com.animesmp;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.*;

public final class AnimeSMPPlugin extends JavaPlugin {
    private final Map<UUID, List<String>> slots = new HashMap<>();
    private final Map<UUID, String> originalNames = new HashMap<>();
    private NamespacedKey weaponKey;

    private static final List<String> CHARACTERS = List.of(
        "Goku", "Vegeta", "Naruto", "Sasuke", "Luffy", "Zoro", "Ichigo",
        "Saitama", "Gojo", "Sukuna", "Tanjiro", "Zenitsu", "Eren", "Levi",
        "Killua", "Gon", "AllMight", "Bakugo", "Madara", "Asta",
        "Herobrine", "Entity303", "Null"
    );

    private static final Map<String, List<String>> POWERS = Map.ofEntries(
        Map.entry("Goku", List.of("Ki Blast", "Kamehameha", "Instant Transmission", "Super Saiyan", "Spirit Bomb")),
        Map.entry("Vegeta", List.of("Galick Gun", "Final Flash", "Big Bang Attack", "Saiyan Rage", "Final Explosion")),
        Map.entry("Naruto", List.of("Rasengan", "Shadow Clone", "Kurama Mode", "Sage Mode", "Tailed Beast Bomb")),
        Map.entry("Sasuke", List.of("Chidori", "Amaterasu", "Susanoo", "Sharingan", "Lightning Slash")),
        Map.entry("Luffy", List.of("Gum-Gum Punch", "Gear 2", "Gear 3", "Gear 4", "Gear 5")),
        Map.entry("Zoro", List.of("Three-Sword Style", "Oni Giri", "Dragon Twister", "Asura", "King of Hell")),
        Map.entry("Ichigo", List.of("Getsuga Tensho", "Flash Step", "Bankai", "Hollow Mask", "Final Getsuga")),
        Map.entry("Saitama", List.of("Serious Punch", "Consecutive Punches", "Shockwave", "Leap", "Serious Series")),
        Map.entry("Gojo", List.of("Infinity", "Blue", "Red", "Hollow Purple", "Unlimited Void")),
        Map.entry("Sukuna", List.of("Dismantle", "Cleave", "Fire Arrow", "Malevolent Shrine", "World Slash")),
        Map.entry("Tanjiro", List.of("Water Breathing", "Hinokami Kagura", "Sun Dragon", "Flowing Dance", "Sun Slash")),
        Map.entry("Zenitsu", List.of("Thunderclap", "Sixfold", "Eightfold", "Godspeed", "Thunder Dragon")),
        Map.entry("Eren", List.of("Titan Form", "Ground Slam", "Regeneration", "Hardening", "Titan Roar")),
        Map.entry("Levi", List.of("ODM Dash", "Dual Blade Spin", "Thunder Spear", "Aerial Slash", "Spinning Strike")),
        Map.entry("Killua", List.of("Godspeed", "Lightning Palm", "Thunderbolt", "Rhythm Echo", "Yo-Yo Strike")),
        Map.entry("Gon", List.of("Jajanken Rock", "Jajanken Paper", "Jajanken Scissors", "Enhanced Jump", "Adult Form")),
        Map.entry("AllMight", List.of("Detroit Smash", "Texas Smash", "United States Smash", "Air Pressure", "One For All")),
        Map.entry("Bakugo", List.of("Explosion Dash", "AP Shot", "Howitzer Impact", "Cluster Blast", "Ultimate Explosion")),
        Map.entry("Madara", List.of("Fire Style", "Susanoo", "Meteor Drop", "Wood Style", "Perfect Susanoo")),
        Map.entry("Asta", List.of("Anti-Magic Slash", "Black Form", "Demon-Dweller Slash", "Black Divider", "Black Asta")),
        Map.entry("Herobrine", List.of("Lightning", "Teleport", "Clone Army", "Fear Aura", "Apocalypse")),
        Map.entry("Entity303", List.of("Red Lightning", "Shadow Teleport", "Corruption", "Phantom Army", "303 Destruction")),
        Map.entry("Null", List.of("Void Slash", "Darkness Field", "Shadow Clones", "Void Prison", "Null Dimension"))
    );

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "anime_character_weapon");
        loadSlots();
        Objects.requireNonNull(getCommand("anime")).setExecutor(this);
        getServer().getPluginManager().registerEvents(new PlayerJoinHandler(this), this);
        getLogger().info("AnimeSMP enabled. This is a starter framework; cinematic replay/skins/powers need further implementation.");
    }

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

    private void loadSlots() {
        if (!getConfig().isConfigurationSection("players")) return;
        for (String uuidText : Objects.requireNonNull(getConfig().getConfigurationSection("players")).getKeys(false)) {
            try {
                UUID uuid = UUID.fromString(uuidText);
                List<String> loaded = getConfig().getStringList("players." + uuidText);
                List<String> normalized = new ArrayList<>(List.of("none", "none", "none"));
                for (int i = 0; i < Math.min(3, loaded.size()); i++) normalized.set(i, loaded.get(i));
                slots.put(uuid, normalized);
            } catch (IllegalArgumentException ignored) {
                getLogger().warning("Skipped invalid player UUID in config: " + uuidText);
            }
        }
    }

    private void saveSlots() {
        getConfig().set("players", null);
        for (Map.Entry<UUID, List<String>> entry : slots.entrySet()) {
            getConfig().set("players." + entry.getKey(), entry.getValue());
        }
        saveConfig();
    }

    private List<String> getSlots(UUID uuid) {
        return slots.computeIfAbsent(uuid, key -> new ArrayList<>(List.of("none", "none", "none")));
    }

    private boolean isCharacter(String input) {
        return CHARACTERS.stream().anyMatch(c -> c.equalsIgnoreCase(input));
    }

    private String canonical(String input) {
        return CHARACTERS.stream().filter(c -> c.equalsIgnoreCase(input)).findFirst().orElse(null);
    }

    private boolean mayManage(CommandSender sender) {
        // Console may manage. In-game users require anime.change OR anime.admin.
        return !(sender instanceof Player) || sender.hasPermission("anime.change") || sender.hasPermission("anime.admin");
    }

    private void giveWeapon(Player player, String character) {
        Material material = character.equalsIgnoreCase("Gojo") ? Material.NETHER_STAR :
            character.equalsIgnoreCase("Entity303") || character.equalsIgnoreCase("Null") ? Material.NETHERITE_HOE :
            Material.NETHERITE_SWORD;
        ItemStack item = new ItemStack(material);
        ItemMeta meta = item.getItemMeta();
        if (meta != null) {
            meta.setDisplayName(ChatColor.LIGHT_PURPLE + "" + ChatColor.BOLD + character + "'s Custom Weapon");
            meta.setLore(List.of(ChatColor.GRAY + "Anime SMP character weapon", ChatColor.DARK_PURPLE + "Starter weapon placeholder"));
            meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, character);
            item.setItemMeta(meta);
        }
        player.getInventory().addItem(item).values().forEach(leftover ->
            player.getWorld().dropItemNaturally(player.getLocation(), leftover));
    }

    private void assign(Player target, int slot, String character) {
        List<String> playerSlots = getSlots(target.getUniqueId());
        playerSlots.set(slot - 1, character);
        saveSlots();
        giveWeapon(target, character);
    }

    private void help(CommandSender sender) {
        sender.sendMessage(ChatColor.GOLD + "AnimeSMP commands:");
        sender.sendMessage(ChatColor.YELLOW + "/anime list");
        sender.sendMessage(ChatColor.YELLOW + "/anime powers <character>");
        sender.sendMessage(ChatColor.YELLOW + "/anime slots [player]");
        sender.sendMessage(ChatColor.YELLOW + "/anime set <player> <slot 1-3> <character> " + ChatColor.GRAY + "(Owner/Admin)");
        sender.sendMessage(ChatColor.YELLOW + "/anime give <player> <character> " + ChatColor.GRAY + "(sets next empty slot; Owner/Admin)");
        sender.sendMessage(ChatColor.YELLOW + "/anime weapon <character> " + ChatColor.GRAY + "(Owner/Admin; gives a test weapon)");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0 || args[0].equalsIgnoreCase("help")) {
            help(sender);
            return true;
        }

        switch (args[0].toLowerCase(Locale.ROOT)) {
            case "list" -> sender.sendMessage(ChatColor.AQUA + "Characters: " + String.join(", ", CHARACTERS));
            case "powers" -> {
                if (args.length < 2) { sender.sendMessage(ChatColor.RED + "Use: /anime powers <character>"); return true; }
                String character = canonical(args[1]);
                if (character == null) { sender.sendMessage(ChatColor.RED + "Unknown character."); return true; }
                sender.sendMessage(ChatColor.GOLD + character + " powers: " + String.join(", ", POWERS.getOrDefault(character, List.of("Custom power 1", "Custom power 2", "Custom power 3", "Custom power 4", "Ultimate"))));
                sender.sendMessage(ChatColor.GRAY + "Note: this starter lists powers; ability animations are not implemented yet.");
            }
            case "slots" -> {
                Player target;
                if (args.length >= 2) {
                    if (!mayManage(sender)) { sender.sendMessage(ChatColor.RED + "Only Owner/Admin can view another player's slots."); return true; }
                    target = Bukkit.getPlayerExact(args[1]);
                } else if (sender instanceof Player p) target = p;
                else { sender.sendMessage(ChatColor.RED + "Console: use /anime slots <player>"); return true; }
                if (target == null) { sender.sendMessage(ChatColor.RED + "Player must be online."); return true; }
                sender.sendMessage(ChatColor.GOLD + target.getName() + "'s slots: " + String.join(" | ", getSlots(target.getUniqueId())));
            }
            case "set" -> {
                if (!mayManage(sender)) { sender.sendMessage(ChatColor.RED + "Only Owner/Admin can change anime characters."); return true; }
                if (args.length < 4) { sender.sendMessage(ChatColor.RED + "Use: /anime set <player> <slot 1-3> <character>"); return true; }
                Player target = Bukkit.getPlayerExact(args[1]);
                int slot;
                try { slot = Integer.parseInt(args[2]); } catch (NumberFormatException ex) { slot = 0; }
                String character = canonical(args[3]);
                if (target == null) { sender.sendMessage(ChatColor.RED + "Target player must be online."); return true; }
                if (slot < 1 || slot > 3) { sender.sendMessage(ChatColor.RED + "Slot must be 1, 2, or 3."); return true; }
                if (character == null) { sender.sendMessage(ChatColor.RED + "Unknown character. Use /anime list"); return true; }
                assign(target, slot, character);
                sender.sendMessage(ChatColor.GREEN + "Assigned " + character + " to " + target.getName() + ", slot " + slot + ".");
                target.sendMessage(ChatColor.LIGHT_PURPLE + "An admin assigned " + character + " to your slot " + slot + ".");
            }
            case "give" -> {
                if (!mayManage(sender)) { sender.sendMessage(ChatColor.RED + "Only Owner/Admin can give characters."); return true; }
                if (args.length < 3) { sender.sendMessage(ChatColor.RED + "Use: /anime give <player> <character>"); return true; }
                Player target = Bukkit.getPlayerExact(args[1]);
                String character = canonical(args[2]);
                if (target == null || character == null) { sender.sendMessage(ChatColor.RED + "Player must be online and character must be valid."); return true; }
                List<String> targetSlots = getSlots(target.getUniqueId());
                int empty = targetSlots.indexOf("none");
                if (empty == -1) { sender.sendMessage(ChatColor.RED + "Player already has 3 characters. Use /anime set to replace a slot."); return true; }
                assign(target, empty + 1, character);
                sender.sendMessage(ChatColor.GREEN + "Gave " + character + " to " + target.getName() + ".");
            }
            case "weapon" -> {
                if (!mayManage(sender)) { sender.sendMessage(ChatColor.RED + "Only Owner/Admin can use this command."); return true; }
                if (args.length < 2 || !(sender instanceof Player player)) { sender.sendMessage(ChatColor.RED + "Use in-game: /anime weapon <character>"); return true; }
                String character = canonical(args[1]);
                if (character == null) { sender.sendMessage(ChatColor.RED + "Unknown character."); return true; }
                giveWeapon(player, character);
                sender.sendMessage(ChatColor.GREEN + "Test weapon given. Detailed weapon abilities are not implemented in this starter.");