Viraj peta

Make a God sword name phonix blade enchant 10 all and special powars shift + right click a phonix attack and damge 6 hearts and crafting recipe 20 blaze rod and a special mob head with texture

Kodari AI
KodariOct 2 at 11:56 am 1
PhoenixBladeSword
A Minecraft plugin introducing the legendary Phoenix Blade, a powerful god sword with all enchantments at level 10. The blade features a unique Phoenix Strike ability triggered by shift+right-click, unleashing a fiery phoenix attack dealing 6 hearts of damage. Craftable with 20 blaze rods and a special custom mob head with unique texture. Includes custom crafting recipe, enchantment application, special ability cooldown system, and particle effects for the phoenix attack animation. The plugin manages item registration, crafting validation, ability cooldowns, and visual effects for an immersive god-tier weapon experience.

I’ll create a Paper plugin with a custom 20-blaze-rod + textured-head crafting menu, a level-10 enchanted Phoenix Blade, and its shift-right-click attack.

Created the Phoenix Blade plugin and its custom crafting menu. The blade is enchanted to level 10 where supported, and shift-right-click launches an attack that deals 6 hearts of damage.

The recipe currently has a blocker: the textured Blazing Core is created internally, but there’s no way for a player to obtain it, so they can’t complete the craft. The requested create-only restriction prevented me from correcting that after the initial files were created.

Viraj peta

How work

Kodari AI
KodariOct 2 at 12:08 pm 1

Use it in-game like this:

  1. Run /phoenixblade to open the crafting menu.

  2. Put 20 Blaze Rods and the Blazing Core in the open ingredient slots, then click Craft Phoenix Blade.

  3. Hold the Phoenix Blade, aim at a living target, and sneak + right-click. It shoots a flame attack up to 24 blocks, dealing 6 hearts and setting the target on fire. There’s a 3-second cooldown.

Important: the current plugin doesn’t provide a way to obtain the Blazing Core, so you can’t complete the recipe yet. The sword gets supported enchantments at level 10 when crafted.

Viraj peta

Blazing Core

Kodari AI
KodariOct 2 at 12:08 pm 1

The Blazing Core is the special textured mob head needed for the Phoenix Blade recipe. It’s created by the plugin, but currently there’s no command or recipe for players to obtain it—so the sword can’t be crafted yet.

Viraj peta

How I can get Blazing Core

Kodari AI
KodariOct 2 at 12:09 pm 1
  • Add /phoenixblade core to give the player the existing textured Blazing Core.

  • Restrict the item command to operators with the phoenixblade.core permission.

You can now get one with /phoenixblade core. It’s restricted to operators by default. Then run /phoenixblade, add the Blazing Core and 20 Blaze Rods to the crafting menu, and click the craft button.

Viraj peta

How I can make without op

Kodari AI
KodariOct 2 at 12:11 pm 1
  • Allow phoenixblade.core by default so non-OP players can use /phoenixblade core.

Non-OP players can now use /phoenixblade core by default. Restart the server or reload the plugin for the permission change to take effect.

Viraj peta

Not working btw

Kodari AI
KodariOct 2 at 12:44 pm 1

I’ll remove both command permission gates so non-OP players can open the menu and claim the core without needing a permission setup.

Removed the permission checks. After installing the updated plugin and restarting the server, non-OP players can use /phoenixblade core to get the Blazing Core and /phoenixblade to open the crafting menu.

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

import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.profiles.builder.XSkull;
import com.cryptomorin.xseries.profiles.objects.Profileable;
import com.cryptomorin.xseries.particles.XParticle;
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.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.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.util.RayTraceResult;
import org.bukkit.util.Vector;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;

public final class PhoenixBladePlugin extends org.bukkit.plugin.java.JavaPlugin implements Listener, CommandExecutor {
    private static final String[] ENCHANTMENTS = {
            "PROTECTION", "FIRE_PROTECTION", "FEATHER_FALLING", "BLAST_PROTECTION", "PROJECTILE_PROTECTION",
            "RESPIRATION", "AQUA_AFFINITY", "THORNS", "DEPTH_STRIDER", "FROST_WALKER", "BINDING_CURSE",
            "SOUL_SPEED", "SWIFT_SNEAK", "SHARPNESS", "SMITE", "BANE_OF_ARTHROPODS", "KNOCKBACK",
            "FIRE_ASPECT", "LOOTING", "SWEEPING_EDGE", "EFFICIENCY", "SILK_TOUCH", "UNBREAKING",
            "FORTUNE", "POWER", "PUNCH", "FLAME", "INFINITY", "LUCK_OF_THE_SEA", "LURE", "LOYALTY",
            "IMPALING", "RIPTIDE", "CHANNELING", "MULTISHOT", "QUICK_CHARGE", "PIERCING", "DENSITY",
            "BREACH", "WIND_BURST", "MENDING", "VANISHING_CURSE"
    };
    private static final Set<Integer> INPUT_SLOTS = Set.of(10, 11, 12, 13, 14, 15, 16);

    private final Map<UUID, Long> lastAttack = new ConcurrentHashMap<>();
    private NamespacedKey bladeKey;
    private NamespacedKey headKey;
    private Material blazeRodMaterial;

    @Override
    public void onEnable() {
        bladeKey = new NamespacedKey(this, "phoenix_blade");
        headKey = new NamespacedKey(this, "phoenix_crafting_head");
        blazeRodMaterial = XMaterial.matchXMaterial("BLAZE_ROD")
                .map(XMaterial::parseMaterial)
                .orElseThrow(() -> new IllegalStateException("BLAZE_ROD is unavailable"));
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("phoenixblade").setExecutor(this);
    }

    @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;
        }
        if (args.length > 0 && args[0].equalsIgnoreCase("core")) {
            returnItems(player, createBlazingCore());
            player.sendMessage(ChatColor.GOLD + "You received a Blazing Core.");
            return true;
        }
        openCraftingMenu(player);
        return true;
    }

    private void openCraftingMenu(Player player) {
        CraftMenuHolder holder = new CraftMenuHolder();
        Inventory inventory = Bukkit.createInventory(holder, 27, ChatColor.DARK_RED + "Phoenix Blade Crafting");
        holder.inventory = inventory;
        inventory.setItem(4, menuItem("PAPER", ChatColor.GOLD + "Recipe", List.of(
                ChatColor.GRAY + "Add 20 Blaze Rods and the", ChatColor.GRAY + "Blazing Core to the slots below.")));
        inventory.setItem(22, menuItem("EMERALD", ChatColor.GREEN + "Craft Phoenix Blade", List.of(
                ChatColor.GRAY + "Click to craft when the", ChatColor.GRAY + "required ingredients are present.")));
        player.openInventory(inventory);
    }

    private ItemStack menuItem(String materialName, String name, List<String> lore) {
        ItemStack item = XMaterial.matchXMaterial(materialName)
                .map(XMaterial::parseItem)
                .orElseThrow(() -> new IllegalStateException(materialName + " is unavailable"));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(name);
        meta.setLore(lore);
        item.setItemMeta(meta);
        return item;
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (!(event.getView().getTopInventory().getHolder() instanceof CraftMenuHolder)) {
            return;
        }
        int rawSlot = event.getRawSlot();
        if (rawSlot == 22) {
            event.setCancelled(true);
            if (event.getWhoClicked() instanceof Player player) {
                craftBlade(player, event.getView().getTopInventory());
            }
            return;
        }
        if (rawSlot >= 0 && rawSlot < event.getView().getTopInventory().getSize()
                && !INPUT_SLOTS.contains(rawSlot)) {
            event.setCancelled(true);
            return;
        }
        if (event.isShiftClick() || event.getClick() == ClickType.NUMBER_KEY
                || event.getClick() == ClickType.SWAP_OFFHAND || event.getClick() == ClickType.DOUBLE_CLICK) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        if (!(event.getView().getTopInventory().getHolder() instanceof CraftMenuHolder)) {
            return;
        }
        for (int rawSlot : event.getRawSlots()) {
            if (rawSlot < event.getView().getTopInventory().getSize()
                    && !INPUT_SLOTS.contains(rawSlot)) {
                event.setCancelled(true);
                return;
            }
        }
    }

    @EventHandler
    public void onInventoryClose(InventoryCloseEvent event) {
        if (!(event.getInventory().getHolder() instanceof CraftMenuHolder)
                || !(event.getPlayer() instanceof Player player)) {
            return;
        }
        for (int slot : INPUT_SLOTS) {
            ItemStack item = event.getInventory().getItem(slot);
            if (item == null || item.getType().isAir()) {
                continue;
            }
            event.getInventory().setItem(slot, null);
            returnItems(player, item);
        }
    }

    private void craftBlade(Player player, Inventory inventory) {
        int rodCount = 0;
        boolean hasBlazingCore = false;
        for (int slot : INPUT_SLOTS) {
            ItemStack item = inventory.getItem(slot);
            if (item == null) {
                continue;
            }
            if (item.getType().equals(blazeRodMaterial)) {
                rodCount += item.getAmount();
            } else if (isBlazingCore(item)) {
                hasBlazingCore = true;
            }
        }
        if (rodCount < 20 || !hasBlazingCore) {
            player.sendMessage(ChatColor.RED + "You need 20 Blaze Rods and the Blazing Core.");
            return;
        }

        int rodsToConsume = 20;
        boolean coreConsumed = false;
        for (int slot : INPUT_SLOTS) {
            ItemStack item = inventory.getItem(slot);
            if (item == null) {
                continue;
            }
            if (item.getType().equals(blazeRodMaterial) && rodsToConsume > 0) {
                int amountToConsume = Math.min(rodsToConsume, item.getAmount());
                rodsToConsume -= amountToConsume;
                int remaining = item.getAmount() - amountToConsume;
                inventory.setItem(slot, remaining == 0 ? null : new ItemStack(item.getType(), remaining));
            } else if (!coreConsumed && isBlazingCore(item)) {
                coreConsumed = true;
                inventory.setItem(slot, null);
            }
        }

        returnItems(player, createPhoenixBlade());
        XSound.matchXSound("ENTITY_PLAYER_LEVELUP").ifPresent(sound -> sound.play(player));
        player.sendMessage(ChatColor.GOLD + "You crafted the Phoenix Blade!");
    }