Akarsh Jadson
📎 1 file 4,430 chars
📄
pasted-code-1794064585822.txt
txt 101 lines
▶
ok make a plugin that includes classes, i want there to be 5 classes, 

the name of the plugin would be "Wraith Plugin"

1. warrior 
2. ranger
3. sage

each class would get randomly assigned to a player and have different buffs and debuffs.

Medieval coin- it is the currency for this server, its like strength on strength smp, each player starts off with 2 Medieval coins. The lose one on dying to player and gain one on killing a player. You may withdraw them by /withdraw, just like lifesteal with hearts or strength smp with strength. 

You can upgrade your class through something called a upgrade scroll (recepie for crafting grind being 4 gold blocks on each corner, Medieval Coin in centre and diamond block in remaining slots). Note- abilities after using replace abilities of base form.(This is similar to bliss smp upgrade where your gems gets upgraded to tier 2). You need atleast 1 kill to craft a upgrade scroll, so players dont instantly create a scroll upon joining the server.

Just like /bliss trust, there will also be a /trust command to ally with other players, here no debuffs apllied by a player can affect their allies and all group buffs that can be applied will be applied to their allies near them in a 20 block radius.


Warrior:-

Abilities-

Rage - Increase damage by 20% per hit. (applies to every tool/weapon). Lasts for 25 seconds.
Cooldown -35s

Ground Slam- Smash the ground, damaging and knocking back nearby enemies in a circle around player. (dmg-1 heart)
Cooldown -25s

Blood Rush- Dash in straight line towards an enemy and strike. dash ends as soon as they touch enemy or after 2 seconds without touching enemy.(dmg- 1 heart)
Cooldown -20s

Passive: Has permanent strength 1.Gets sharpness 1 on all weapons. 

Warrior + upgrade scroll = Warrior knight
Warrior Knight:-

Passives are same as base warrior except has sharp 4 on all weapons.

Abilities-

Rage - same as base "rage" ability with same duration and cooldown, only difference increase damage by 30% per hit. 

Undying Spirit - when reaching below 3 hearts , player gets resistance 5 and regen 3.Duration is 10s
Cooldown- 35s

Blood Rush- stays the same as base form but duration is 3.5 seconds and dmg is 2 hearts, same cooldown.

Ranger:-

Abilities- (abilities including arrows require bow or crossbow)

Explosive Arrow - Shoot 3 arrows that explode on hitting player dealing 1 heart per hit.
Cooldown- 20s

Eagle Eye - track enemies location for 20 seconds, for player, enemy appears with outline glowing red and can appear even through blocks, however the player must see the enemy first and then press the keybind. The player getting tracked gets the text "You are being tracked" in red appear on their screen once for 3 seconds.
Cooldown- 40s

Wind Dash - Dash 3 blocks in any direction upon pressing.
Cooldown- 15 seconds

Passive: has perm speed 1. Gets infinity only on bow and piercing only on crossbow.

Ranger + upgrade scroll = Marksman
Marksman:-

Explosive arrow - shoot 5 arrows instead of 3.
Cooldown- 30s

Tether Trap - shoot an arrow that if it hits a target applies slowness 3 to them for 15s
Cooldown- 25s

Wind Dash- same as base but dash 5 blocks instead of 3.
Cooldown- 20s 

Sage:-

Abilities- 

Fireball- Launch fireball to where player is looking, point blank damage on enemy deals 3 hearts, splash damage deals 1 heart if 0-2 blocks away or 1.5 heart if 2-3 blocks away.
Cooldown- 30s

Heal Zone- creates healing zone of a 2x2 block area that is placed down and cannot move to heal player and allies. Applies regen 2 as long as u stay in the zone and speed 1 for 20s(even outside the zone), same for both player casting it and allies.
Cooldown- 25s

Invisibility- when activated, applies blindness to all enemies around the player casting it (except allies). Duration is 7s.
Cooldown- 30s

Passive: has increased potion duration limit (3min-4min, 1:30min-2min, 8min-9min)

Sage + upgrade scroll = Alchemist
Alchemist:-

Fireball- same as base but point blank dmg is 4 hearts and splash dmg is 1.5 for maximum of 2 blocks away.
Cooldown- 40s

Heal Zone- same as base but regen 2 becomes regen 4 and speed 1 for 30 seconds.
Cooldown- 40s

Final Spell- can activate only when 3 or below 3 hearts. Gives player invisibility for 30s, strength 1 for 15s, speed 1 for 15s and regen 3 for 20s.
Cooldown- 45s

Kodari AI
KodariNov 7 at 3:22 pm 3
WraithClasses
A medieval-themed Minecraft plugin that randomly assigns players one of three classes (Warrior, Ranger, Sage) with unique abilities, buffs, and debuffs. Features a Medieval Coin currency system where players start with 2 coins, gain one on kills, and lose one on death, withdrawable via /withdraw. Includes a /trust command for ally mechanics with 20-block radius group buffs and debuff immunity. Classes can be upgraded via craftable upgrade scrolls (requiring at least 1 kill) to advanced forms (Warrior Knight, Marksman, Alchemist) with enhanced abilities. Each class has active abilities with cooldowns, passives, and upgraded variants with stronger effects.
  1. Add the Paper plugin project files and persistent profiles for random class assignment, coins, kills, and allies.

  2. Implement the coin/scroll items, gated upgrade recipe, withdrawal, redemption, and trust commands.

  3. Add class passives and ability commands with cooldowns, damage rules, and ally protections.

Created the Wraith Plugin with random Warrior, Ranger, or Sage assignment; their listed upgraded forms; persistent Medieval Coins and kills; the kill-gated scroll recipe; and mutual alliances that block friendly damage and debuffs.

Use /class, /ability <name> [direction], /withdraw [amount], and /trust <player|accept|deny|remove|list>. Abilities use commands because server plugins can’t add client keybinds. I interpreted Sage’s unspecified potion-duration passive as extending effects by 25%, up to 9 minutes.

Akarsh Jadson

My Paper 1.21.11 server is failing to enable WraithPlugin v1.0.0.

The console reports this error:

java.lang.IllegalArgumentException: Crafting rows should be 1, 2, or 3 characters

Please do the following:

  1. Inspect all crafting recipes registered in the plugin.
  2. Identify the recipe or recipes causing this error.
  3. Fix all invalid recipe shapes. Each row must contain between 1 and 3 characters, and all rows in a shaped recipe must have equal lengths.
  4. Check that all ingredient characters are correctly mapped to valid materials.
  5. Make sure no other plugin functionality is affected.
  6. Preserve all existing commands, permissions, classes, abilities, currency systems and configurations.
  7. Ensure compatibility with Paper 1.21.11.
  8. Rebuild the complete plugin and provide the corrected .jar file.

Do not simply explain the fix. Actually modify the source code, build the plugin and verify that it compiles successfully.

Kodari AI
KodariNov 7 at 4:26 pm 1
  1. Fix the malformed scroll recipe rows while preserving its 3×3 layout.

  2. Keep the existing gold-block, diamond-block, and Medieval Coin ingredient mappings and all other plugin behavior unchanged.

  3. The project will be compiled by Kodari’s build verifier; I can’t attach a .jar directly here.

Fixed the only registered recipe: its "G D G" rows were five characters because the spaces count toward the row limit. The shape is now "GDG", "DCD", "GDG"; each row is three characters. The mappings remain G = gold block, D = diamond block, and C = gold nugget, with the existing crafting check requiring a Medieval Coin in the center. No other functionality was changed.

To build and download the corrected jar, click Compile in the top bar, then click Compile in the window. When the build succeeds, click Download on that build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
8 1,233
src/main/java/com/kodari/wraith/WraithPlugin.java
package com.kodari.wraith;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
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.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
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.CraftingInventory;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.UUID;

public class WraithPlugin extends JavaPlugin implements Listener {
    private ProfileManager profiles;
    private AbilityManager abilities;
    private NamespacedKey coinKey;
    private NamespacedKey scrollKey;
    private NamespacedKey recipeKey;

    @Override
    public void onEnable() {
        this.profiles = new ProfileManager(this);
        this.coinKey = new NamespacedKey(this, "medieval_coin");
        this.scrollKey = new NamespacedKey(this, "upgrade_scroll");
        this.recipeKey = new NamespacedKey(this, "upgrade_scroll");
        this.abilities = new AbilityManager(this, profiles);

        Bukkit.getPluginManager().registerEvents(this, this);
        Bukkit.getPluginManager().registerEvents(abilities, this);
        registerCommands();
        registerScrollRecipe();

        Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(abilities::refreshPassives), 20L, 100L);
        for (Player player : Bukkit.getOnlinePlayers()) {
            profiles.get(player.getUniqueId());
            abilities.refreshPassives(player);
        }
    }

    @Override
    public void onDisable() {
        if (profiles != null) {
            profiles.save();
        }
    }

    private void registerCommands() {
        getCommand("class").setExecutor(this);
        getCommand("ability").setExecutor(this);
        getCommand("withdraw").setExecutor(this);
        getCommand("trust").setExecutor(this);
    }

    private void registerScrollRecipe() {
        Bukkit.removeRecipe(recipeKey);
        ShapedRecipe recipe = new ShapedRecipe(recipeKey, createUpgradeScroll());
        recipe.shape("GDG", "DCD", "GDG");
        recipe.setIngredient('G', requiredMaterial("GOLD_BLOCK"));
        recipe.setIngredient('D', requiredMaterial("DIAMOND_BLOCK"));
        recipe.setIngredient('C', requiredMaterial("GOLD_NUGGET"));
        Bukkit.addRecipe(recipe);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used in-game.");
            return true;
        }

        return switch (command.getName().toLowerCase(Locale.ROOT)) {
            case "class" -> showClass(player);
            case "ability" -> useAbility(player, args);
            case "withdraw" -> withdraw(player, args);
            case "trust" -> trustCommand(player, args);
            default -> false;
        };
    }

    private boolean showClass(Player player) {
        PlayerProfile profile = profiles.get(player.getUniqueId());
        player.sendMessage("§6Your class: §e" + profile.getClassType().displayName(profile.isUpgraded()));
        player.sendMessage("§6Medieval Coins: §e" + profile.getCoins() + " §7| §6Player kills: §e" + profile.getKills());
        player.sendMessage("§7Abilities: §f/ability <name> [direction]");
        player.sendMessage("§7Upgrade: craft an Upgrade Scroll after at least one player kill, then right-click it.");
        return true;
    }

    private boolean useAbility(Player player, String[] args) {
        if (args.length == 0) {
            player.sendMessage("§cUsage: /ability <rage|slam|bloodrush|explosivearrow|eagleeye|winddash|tethertrap|fireball|healzone|invisibility|finalspell> [direction]");
            return true;
        }
        abilities.activate(player, args[0], args.length > 1 ? args[1] : "");
        return true;
    }

    private boolean withdraw(Player player, String[] args) {
        int amount = 1;
        if (args.length > 0) {
            try {
                amount = Integer.parseInt(args[0]);
            } catch (NumberFormatException exception) {
                player.sendMessage("§cAmount must be a whole number.");
                return true;
            }
        }
        if (amount <= 0) {
            player.sendMessage("§cAmount must be greater than zero.");
            return true;
        }

        PlayerProfile profile = profiles.get(player.getUniqueId());
        if (profile.getCoins() < amount) {
            player.sendMessage("§cYou do not have enough Medieval Coins.");
            return true;
        }

        profile.setCoins(profile.getCoins() - amount);
        profiles.saveProfile(profile);
        int remaining = amount;
        while (remaining > 0) {
            int stackSize = Math.min(64, remaining);
            player.getWorld().dropItemNaturally(player.getLocation(), createCoin(stackSize));
            remaining -= stackSize;
        }
        player.sendMessage("§aWithdrew §e" + amount + " §aMedieval Coin(s).");
        return true;
    }

    private boolean trustCommand(Player player, String[] args) {
        if (args.length == 0) {
            player.sendMessage("§cUsage: /trust <player|accept|deny|remove|list> [player]");
            return true;
        }

        switch (args[0].toLowerCase(Locale.ROOT)) {
            case "accept" -> {
                if (args.length < 2) {
                    player.sendMessage("§cUsage: /trust accept <player>");
                    return true;
                }
                Player target = Bukkit.getPlayerExact(args[1]);
                if (target == null || !abilities.acceptTrust(player, target)) {
                    player.sendMessage("§cNo pending trust request from that online player.");
                    return true;
                }
                player.sendMessage("§aYou are now allied with §e" + target.getName() + "§a.");
                target.sendMessage("§aYou are now allied with §e" + player.getName() + "§a.");
            }
            case "deny" -> {
                if (args.length < 2 || !abilities.denyTrust(player, args[1])) {
                    player.sendMessage("§cNo pending trust request from that player.");
                } else {
                    player.sendMessage("§7Trust request denied.");
                }
            }
            case "remove" -> {
                if (args.length < 2) {
                    player.sendMessage("§cUsage: /trust remove <player>");
                    return true;
                }
                Player target = Bukkit.getPlayerExact(args[1]);
                if (target == null || !abilities.removeTrust(player, target)) {
                    player.sendMessage("§cThat player is not in your alliance.");
                } else {
                    player.sendMessage("§7Alliance removed.");
                    target.sendMessage("§7Your alliance with §e" + player.getName() + " §7was removed.");
                }
            }
            case "list" -> {
                List<String> names = new ArrayList<>();
                for (UUID uuid : profiles.get(player.getUniqueId()).getTrusted()) {
                    String name = Bukkit.getOfflinePlayer(uuid).getName();
                    names.add(name == null ? uuid.toString() : name);
                }
                player.sendMessage(names.isEmpty() ? "§7You have no allies." : "§6Allies: §f" + String.join(", ", names));
            }
            default -> {
                Player target = Bukkit.getPlayerExact(args[0]);
                if (target == null || target.equals(player)) {
                    player.sendMessage("§cThat player must be online and cannot be yourself.");
                } else if (abilities.isAlly(player, target)) {