Gurjap Singh

Create a Spigot/Paper 1.21+ Java plugin named "Jujutsu smp s5" that introduces 6 endgame weapons with custom abilities, right/left-click triggers, crafting recipes strictly using Overworld and Nether materials, and a server-wide Crafting Ritual BossBar system.

---

CRAFTING RITUAL BOSSBAR SYSTEM

  • Trigger: Whenever a player crafts any of the 6 custom weapons via CraftItemEvent.
  • BossBar Appearance:

- Color: PURPLE | Style: SOLID - Format: "RITUAL ACTIVE: <Player> (<Weapon>) @ X:<x> Y:<y> Z:<z> [<MM:SS>]"

  • Duration & Behavior:

- Lasts for exactly 15 minutes (900 seconds). - Progress bar decreases smoothly from 1.0 (100%) to 0.0 (0%) over 15 minutes. - Broadcasted to all online players globally. - Dynamically adds any newly joined players during the active ritual duration.

---

WEAPON SPECIFICATIONS & ABILITIES

  1. Bloom Hammer (Material: MACE)

- Enchantments: Density VI, Wind Burst II, Unbreaking IV - Ability (Shift + Right Click): Dash 20 blocks forward in player looking direction (5s cooldown).

  1. Beast Sword (Material: NETHERITE_SWORD)

- Enchantments: Unbreaking IV - Ability 1 (Shift + Right Click on Player): Explode targeted player like TNT without block damage (20s cooldown). - Ability 2 (Shift + Left Click): Grant Speed II and Strength IV for 30 seconds (20s cooldown).

  1. Ultimate Bow (Material: BOW)

- Enchantments: Unbreaking IV - Ability 1 (Shift + Right Click): Power Mode for 10s (Arrows deal 6 damage / 3 Hearts). - Ability 2 (Shift + Left Click): Launch Mega Arrow dealing 16 damage / 8 Hearts (60s cooldown).

  1. Phantom Dagger (Material: NETHERITE_SWORD)

- Enchantments: Unbreaking IV - Ability (Shift + Right Click): Grant Invisibility I for 5 seconds (15s cooldown).

  1. Thunder Axe (Material: NETHERITE_AXE)

- Enchantments: Unbreaking IV - Ability (Shift + Right Click): Strike lightning at target block within 30 blocks (10s cooldown).

  1. Scythe of Doom (Material: NETHERITE_HOE)

- Enchantments: Unbreaking IV - Ability 1 (Shift + Right Click): Pull living entities within 10 blocks + apply Wither III and Darkness for 4s (20s cooldown). - Ability 2 (Shift + Left Click): Soul Drain Wave dealing 8 damage (4 Hearts) in 12 blocks and healing 4 health (2 Hearts) (20s cooldown).

---

CRAFTING RECIPES (Hard Overworld & Nether Tier Only)

  1. Bloom Hammer:

[ Wind Charge ] [ Heavy Core ] [ Wind Charge ] [ Nether Star ] [ Breeze Rod ] [ Nether Star ] [ Air ] [ Breeze Rod ] [ Air ]

  1. Beast Sword:

[ Nether Star ] [ Respawn Anchor ] [ Nether Star ] [ Wither Skeleton Skull ] [ Netherite Sword] [ Wither Skeleton Skull ] [ Crying Obsidian ] [ Blaze Rod ] [ Crying Obsidian ]

  1. Ultimate Bow:

[ Breeze Rod ] [ Nether Star ] [ String ] [ Bow ] [ Heart of the Sea] [ String ] [ Breeze Rod ] [ Nether Star ] [ String ]

  1. Phantom Dagger:

[ Echo Shard ] [ Netherite Ingot ] [ Echo Shard ] [ Phantom Membrane ] [ Netherite Sword ] [ Phantom Membrane ] [ Air ] [ Nether Star ] [ Air ]

  1. Thunder Axe:

[ Lightning Rod ] [ Netherite Axe ] [ Lightning Rod ] [ Heart of the Sea ] [ Nether Star ] [ Heart of the Sea ] [ Air ] [ Diamond Block ] [ Air ]

  1. Scythe of Doom:

[ Wither Skeleton Skull ] [ Netherite Ingot ] [ Netherite Ingot ] [ Nether Star ] [ Netherite Hoe ] [ Air ] [ Air ] [ Blaze Rod ] [ Air ]

---

GENERAL REQUIREMENTS

  • Include /giveweapons command (Permission: jujutsusmps5.admin).
  • Main-hand validation check before triggering skills.
  • Custom Arrow metadata tags to calculate damage boost correctly.
Kodari AI
KodariOct 2 at 6:23 am 1
JujutsuSmpS5Weapons
Endgame weapon plugin for Jujutsu SMP Season 5 on Paper 1.21+. Introduces 6 craftable legendary weapons (Bloom Hammer, Beast Sword, Ultimate Bow, Phantom Dagger, Thunder Axe, Scythe of Doom) with unique shift-click abilities, cooldowns, and custom crafting recipes using only Overworld and Nether materials. Features a global Crafting Ritual BossBar system that broadcasts purple progress bars for 15 minutes when weapons are crafted, dynamically tracking all online players. Includes /giveweapons admin command for item distribution.
  1. Create the Gradle project and plugin descriptor for Spigot/Paper 1.21+.

  2. Implement the six tagged weapons, exact recipes, click abilities, cooldowns, and custom-arrow damage.

  3. Add the global 15-minute ritual BossBar and /giveweapons admin command.

Created the Jujutsu smp s5 plugin with six tagged weapons and recipes, their click-triggered abilities and cooldowns, custom arrow damage tags, the global 15-minute crafting ritual BossBar, and the permission-protected /giveweapons command.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
4 577
src/main/java/com/jujutsusmps5/JujutsuSmpS5Plugin.java
package com.jujutsusmps5;

import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.boss.BarColor;
import org.bukkit.boss.BarStyle;
import org.bukkit.boss.BossBar;
import org.bukkit.entity.Arrow;
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.entity.EntityShootBowEvent;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerAnimationType;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
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.util.RayTraceResult;
import org.bukkit.util.Vector;
import org.bukkit.FluidCollisionMode;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

public final class JujutsuSmpS5Plugin extends JavaPlugin implements Listener {
    private static final long RITUAL_DURATION_NANOS = 900_000_000_000L;
    private final Map<String, Long> cooldowns = new HashMap<>();
    private final Map<UUID, Long> powerModeExpiry = new HashMap<>();
    private final Set<Ritual> activeRituals = new HashSet<>();

    private NamespacedKey weaponKey;
    private NamespacedKey arrowMarkerKey;
    private NamespacedKey arrowDamageKey;

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "weapon_id");
        arrowMarkerKey = new NamespacedKey(this, "custom_weapon_arrow");
        arrowDamageKey = new NamespacedKey(this, "custom_arrow_damage");

        registerRecipes();
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("giveweapons").setExecutor((sender, command, label, args) -> giveWeapons(sender, args));
    }

    @Override
    public void onDisable() {
        for (Ritual ritual : new ArrayList<>(activeRituals)) {
            Bukkit.getScheduler().cancelTask(ritual.taskId);
            ritual.bar.removeAll();
        }
        activeRituals.clear();
    }

    private void registerRecipes() {
        addRecipe("bloom_hammer", "bloom_hammer", new String[]{"WHW", "NBN", " B "},
                new char[]{'W', 'H', 'N', 'B'}, new String[]{"WIND_CHARGE", "HEAVY_CORE", "NETHER_STAR", "BREEZE_ROD"});
        addRecipe("beast_sword", "beast_sword", new String[]{"NRN", "SAS", "CBC"},
                new char[]{'N', 'R', 'S', 'A', 'C', 'B'}, new String[]{"NETHER_STAR", "RESPAWN_ANCHOR", "WITHER_SKELETON_SKULL", "NETHERITE_SWORD", "CRYING_OBSIDIAN", "BLAZE_ROD"});
        addRecipe("ultimate_bow", "ultimate_bow", new String[]{"BNS", "OHS", "BNS"},
                new char[]{'B', 'N', 'S', 'O', 'H'}, new String[]{"BREEZE_ROD", "NETHER_STAR", "STRING", "BOW", "HEART_OF_THE_SEA"});
        addRecipe("phantom_dagger", "phantom_dagger", new String[]{"ENE", "MSM", " N "},
                new char[]{'E', 'N', 'M', 'S'}, new String[]{"ECHO_SHARD", "NETHERITE_INGOT", "PHANTOM_MEMBRANE", "NETHERITE_SWORD"});
        addRecipe("thunder_axe", "thunder_axe", new String[]{"LAL", "HNH", " D "},
                new char[]{'L', 'A', 'H', 'N', 'D'}, new String[]{"LIGHTNING_ROD", "NETHERITE_AXE", "HEART_OF_THE_SEA", "NETHER_STAR", "DIAMOND_BLOCK"});
        addRecipe("scythe_of_doom", "scythe_of_doom", new String[]{"SII", "NH ", " B "},
                new char[]{'S', 'I', 'N', 'H', 'B'}, new String[]{"WITHER_SKELETON_SKULL", "NETHERITE_INGOT", "NETHER_STAR", "NETHERITE_HOE", "BLAZE_ROD"});
    }

    private void addRecipe(String recipeId, String weaponId, String[] shape, char[] symbols, String[] materials) {
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, recipeId), createWeapon(weaponId));
        recipe.shape(shape);
        for (int i = 0; i < symbols.length; i++) {
            recipe.setIngredient(symbols[i], material(materials[i]));
        }
        Bukkit.addRecipe(recipe);
    }

    private ItemStack createWeapon(String id) {
        String materialName;
        String displayName;
        List<String> lore = new ArrayList<>();
        switch (id) {
            case "bloom_hammer" -> {
                materialName = "MACE";
                displayName = "&dBloom Hammer";
                lore.add("&7Shift + Right Click: Dash 20 blocks");
                addEnchantment(lore, "DENSITY", 6);
                addEnchantment(lore, "WIND_BURST", 2);
                addEnchantment(lore, "UNBREAKING", 4);
            }
            case "beast_sword" -> {
                materialName = "NETHERITE_SWORD";
                displayName = "&cBeast Sword";
                lore.add("&7Shift + Right Click a player: TNT blast");
                lore.add("&7Shift + Left Click: Speed II + Strength IV");
                addEnchantment(lore, "UNBREAKING", 4);
            }
            case "ultimate_bow" -> {
                materialName = "BOW";
                displayName = "&6Ultimate Bow";
                lore.add("&7Shift + Right Click: Power Mode (10s)");
                lore.add("&7Shift + Left Click: Mega Arrow");
                addEnchantment(lore, "UNBREAKING", 4);
            }
            case "phantom_dagger" -> {
                materialName = "NETHERITE_SWORD";
                displayName = "&5Phantom Dagger";
                lore.add("&7Shift + Right Click: Invisibility I (5s)");
                addEnchantment(lore, "UNBREAKING", 4);
            }
            case "thunder_axe" -> {
                materialName = "NETHERITE_AXE";
                displayName = "&bThunder Axe";
                lore.add("&7Shift + Right Click: Lightning strike");
                addEnchantment(lore, "UNBREAKING", 4);
            }
            case "scythe_of_doom" -> {
                materialName = "NETHERITE_HOE";
                displayName = "&4Scythe of Doom";
                lore.add("&7Shift + Right Click: Pull, Wither III, Darkness");
                lore.add("&7Shift + Left Click: Soul Drain Wave");
                addEnchantment(lore, "UNBREAKING", 4);
            }
            default -> throw new IllegalArgumentException("Unknown weapon: " + id);
        }

        ItemStack item = new ItemStack(material(materialName));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(color(displayName));
        List<String> coloredLore = new ArrayList<>();
        for (String line : lore) {
            coloredLore.add(color(line));
        }
        meta.setLore(coloredLore);
        switch (id) {
            case "bloom_hammer" -> {
                applyEnchantment(meta, "DENSITY", 6);
                applyEnchantment(meta, "WIND_BURST", 2);
                applyEnchantment(meta, "UNBREAKING", 4);
            }
            case "beast_sword", "ultimate_bow", "phantom_dagger", "thunder_axe", "scythe_of_doom" ->
                    applyEnchantment(meta, "UNBREAKING", 4);
            default -> {
            }
        }
        meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, id);
        item.setItemMeta(meta);
        return item;
    }

    private void addEnchantment(List<String> lore, String enchantment, int level) {
        XEnchantment.matchXEnchantment(enchantment).ifPresent(value -> lore.add("&7" + titleCase(enchantment) + " " + roman(level)));
    }

    private void applyEnchantment(ItemMeta meta, String enchantment, int level) {
        XEnchantment.matchXEnchantment(enchantment)
                .ifPresent(value -> meta.addEnchant(value.getEnchant(), level, true));
    }

    private String getWeaponId(ItemStack item) {
        if (item == null || !item.hasItemMeta()) {
            return null;
        }
        return item.getItemMeta().getPersistentDataContainer().get(weaponKey, PersistentDataType.STRING);
    }

    private Material material(String name) {
        return XMaterial.matchXMaterial(name)
                .map(XMaterial::parseMaterial)
                .orElseThrow(() -> new IllegalStateException("Unsupported material: " + name));
    }

    private String color(String text) {
        return text.replace('&', '§');
    }