Braydon Copas

🪖 Leviathan Helm

Lore: "The eyes of the deep watch through this helmet."

Stats:

+3 Armor Water Breathing Night Vision underwater +10% Fishing Luck

Special Ability:

Highlights nearby treasure chests within 20 blocks underwater. 🛡️ Leviathan Chestplate

Lore: "Forged from scales harder than diamond."

Stats:

+8 Armor +2 Armor Toughness 20% knockback resistance

Special Ability:

Gain Resistance I while submerged in water. 👖 Leviathan Leggings

Lore: "Swift as the ocean currents."

Stats:

+6 Armor Dolphin's Grace Faster swimming speed

Special Ability:

Create a water-current dash every 30 seconds. 👢 Leviathan Boots

Lore: "The sea itself carries your steps."

Stats:

+3 Armor Depth Strider III Soul Speed III

Special Ability:

Walk on water for 5 seconds after jumping. 👑 Full Set Bonus: Blessing of the Sea King

When all 4 pieces are worn:

✅ Permanent Water Breathing ✅ Permanent Dolphin's Grace ✅ +20% damage with Tridents ✅ Sea creatures become passive ✅ Gain Strength I during rain and thunderstorms

Ultimate Ability: Tidal Surge

Cooldown: 5 minutes

Summon a massive wave that:

Knocks back enemies within 15 blocks Deals 8 hearts of damage Gives the wearer Speed II for 10 seconds 🔨 Crafting Materials 24x Leviathan Scales 8x Heart of the Sea 16x Prismarine Crystals 1x Leviathan Heart. Fishing Master's Rod - Better fishing rewards.

Bottle of Ocean Wind - Temporary Speed effect. Poseidon's Trident - Summons lightning 25% on hit Creates a wave that pushes enemies back right click does 3 to 4 hearts 1min cool down. Tidal Blade - Short forward dash right click 10 sec cool down Chance to shock enemies Extra damage in water. Sailor's Grappling Hook 📖 Lore

"Used by ancient sailors to board enemy ships and scale impossible cliffs."

⚙️ Abilities Right-click a block within 20 blocks.

Pulls you toward the target.

Works on islands, ships, trees, and cliffs. 10-second cooldown. pulls players to you if they are hit by it 🌊 Ocean Bonus

When used over water:

Gain Speed II for 3 seconds.

No fall damage for 5 seconds after grappling. 🔨 Crafting Recipe I = Iron Ingot S = String T = Tripwire Hook. one of each item can be crafted make the crafts

Kodari AI
KodariOct 10 at 9:10 pm 3
OceanicArsenal
Adds a complete ocean-themed equipment set to Minecraft. Includes the Leviathan Armor set with unique underwater abilities, full set bonus granting water breathing, Dolphin's Grace, trident damage boost, and the Tidal Surge ultimate ability. Features the Fishing Master's Rod for better rewards, Poseidon's Trident with lightning strikes and wave attacks, Tidal Blade with dash and shock effects, and Sailor's Grappling Hook for mobility. All items have custom crafting recipes using Leviathan Scales, Hearts of the Sea, and Prismarine Crystals.
  1. Create the plugin entry point and register every custom item recipe.

  2. Implement the armor set bonuses, item abilities, cooldowns, and crafting ingredients.

  3. Add the Bukkit plugin descriptor and build configuration.

Created the Leviathan treasures plugin with crafting recipes for the armor, materials, and all four special items.

Abilities include the armor set bonuses and Tidal Surge (sneak + right-click with the full set), Poseidon’s Trident wave, Tidal Blade dash, Sailor’s Grappling Hook, Ocean Wind speed boost, and improved fishing rewards.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 516
src/main/java/com/kodari/leviathan/LeviathanTreasuresPlugin.java
package com.kodari.leviathan;

import com.cryptomorin.xseries.XAttribute;
import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XItemFlag;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Waterlogged;
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.entity.Entity;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.entity.Trident;
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.EntityDamageEvent;
import org.bukkit.event.entity.EntityTargetLivingEntityEvent;
import org.bukkit.event.player.PlayerFishEvent;
import org.bukkit.event.player.PlayerInteractEntityEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.potion.PotionEffect;
import org.bukkit.util.Vector;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public final class LeviathanTreasuresPlugin extends JavaPlugin implements Listener {
    private final Map<String, Long> cooldowns = new HashMap<>();
    private final Map<UUID, Long> waterWalkUntil = new HashMap<>();
    private final Map<UUID, Long> fallProtectionUntil = new HashMap<>();
    private NamespacedKey itemIdKey;
    private long ticks;

    @Override
    public void onEnable() {
        itemIdKey = new NamespacedKey(this, "item_id");
        Bukkit.getPluginManager().registerEvents(this, this);
        registerRecipes();
        Bukkit.getScheduler().runTaskTimer(this, this::updatePlayers, 20L, 20L);
    }

    private void registerRecipes() {
        addRecipe("leviathan_scale", scale(), new String[]{"PPP", "PNP", "PPP"},
                'P', material("PRISMARINE_SHARD"), 'N', material("NAUTILUS_SHELL"));
        addRecipe("leviathan_heart", leviathanHeart(), new String[]{"PSP", "SHS", "PSP"},
                'P', material("PRISMARINE_CRYSTALS"), 'S', scale(), 'H', material("HEART_OF_THE_SEA"));

        addRecipe("leviathan_helmet", armor("helmet"), new String[]{"SSS", "SHS", "   "},
                'S', scale(), 'H', leviathanHeart());
        addRecipe("leviathan_chestplate", armor("chestplate"), new String[]{"S S", "SHS", "SSS"},
                'S', scale(), 'H', leviathanHeart());
        addRecipe("leviathan_leggings", armor("leggings"), new String[]{"SHS", "S S", "S S"},
                'S', scale(), 'H', leviathanHeart());
        addRecipe("leviathan_boots", armor("boots"), new String[]{"   ", "S S", "SHS"},
                'S', scale(), 'H', leviathanHeart());

        addRecipe("fishing_masters_rod", namedItem("fishing_rod", "FISHING_ROD", "&bFishing Master's Rod",
                        "&7Better rewards from every catch.", 0, 0, 0),
                new String[]{"  S", " SF", "S F"}, 'S', material("STICK"), 'F', material("STRING"));
        addRecipe("ocean_wind", namedItem("ocean_wind", "POTION", "&bBottle of Ocean Wind",
                        "&7Right-click for Speed II.", 0, 0, 0),
                new String[]{" P ", " G ", " P "}, 'P', material("PRISMARINE_CRYSTALS"), 'G', material("GLASS_BOTTLE"));
        addRecipe("poseidons_trident", namedItem("poseidons_trident", "TRIDENT", "&3Poseidon's Trident",
                        "&725% chance to call lightning on hit.", "&7Right-click to unleash a damaging wave.", 0, 0, 0),
                new String[]{" P ", "PSP", " H "}, 'P', material("PRISMARINE_CRYSTALS"),
                'S', scale(), 'H', material("HEART_OF_THE_SEA"));
        addRecipe("tidal_blade", namedItem("tidal_blade", "DIAMOND_SWORD", "&bTidal Blade",
                        "&7Right-click to dash (10s cooldown).", "&7Shocks enemies and deals extra damage in water.", 0, 0, 0),
                new String[]{" P ", " S ", " H "}, 'P', material("PRISMARINE_CRYSTALS"),
                'S', scale(), 'H', material("DIAMOND"));
        addRecipe("sailors_grappling_hook", namedItem("sailors_grappling_hook", "TRIPWIRE_HOOK",
                        "&bSailor's Grappling Hook", "&7Right-click a block within 20 blocks to pull yourself to it.",
                        "&7Pulls hit players to you. (10s cooldown)", 0, 0, 0),
                new String[]{"IS ", "IT ", "I  "}, 'I', material("IRON_INGOT"),
                'S', material("STRING"), 'T', material("TRIPWIRE_HOOK"));
    }

    private void addRecipe(String id, ItemStack result, String[] shape, Object... ingredients) {
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, id), result);
        recipe.shape(shape);
        for (int i = 0; i < ingredients.length; i += 2) {
            char symbol = (Character) ingredients[i];
            Object ingredient = ingredients[i + 1];
            if (ingredient instanceof ItemStack stack) {
                recipe.setIngredient(symbol, new RecipeChoice.ExactChoice(stack));
            } else {
                recipe.setIngredient(symbol, (Material) ingredient);
            }
        }
        Bukkit.addRecipe(recipe);
    }

    private ItemStack scale() {
        return namedItem("leviathan_scale", "PRISMARINE_SHARD", "&bLeviathan Scale",
                "&7A scale from an ancient sea king.", 0, 0, 0);
    }

    private ItemStack leviathanHeart() {
        return namedItem("leviathan_heart", "HEART_OF_THE_SEA", "&3Leviathan Heart",
                "&7The beating core of the deep.", 0, 0, 0);
    }

    private ItemStack armor(String piece) {
        return switch (piece) {
            case "helmet" -> namedItem("leviathan_helmet", "IRON_HELMET",
                    "&3Leviathan Helm", new String[]{"&7The eyes of the deep watch through this helmet.",
                            "&b+3 Armor", "&bWater Breathing", "&bNight Vision underwater", "&b+10% Fishing Luck"},
                    1, 0, 0, EquipmentSlot.HEAD);
            case "chestplate" -> namedItem("leviathan_chestplate", "IRON_CHESTPLATE",
                    "&3Leviathan Chestplate", new String[]{"&7Forged from scales harder than diamond.",
                            "&b+8 Armor", "&b+2 Armor Toughness", "&b20% knockback resistance",
                            "&bResistance I while submerged"}, 2, 2, 0.2, EquipmentSlot.CHEST);
            case "leggings" -> namedItem("leviathan_leggings", "IRON_LEGGINGS",
                    "&3Leviathan Leggings", new String[]{"&7Swift as the ocean currents.",
                            "&b+6 Armor", "&bDolphin's Grace", "&bFaster swimming"},
                    1, 0, 0, EquipmentSlot.LEGS);
            default -> {
                ItemStack boots = namedItem("leviathan_boots", "IRON_BOOTS",
                        "&3Leviathan Boots", new String[]{"&7The sea itself carries your steps.",
                                "&b+3 Armor", "&bDepth Strider III", "&bSoul Speed III",
                                "&bWalk on water briefly after jumping"}, 1, 0, 0, EquipmentSlot.FEET);
                XEnchantment.matchXEnchantment("DEPTH_STRIDER").ifPresent(enchantment -> boots.addUnsafeEnchantment(enchantment.getEnchant(), 3));
                XEnchantment.matchXEnchantment("SOUL_SPEED").ifPresent(enchantment -> boots.addUnsafeEnchantment(enchantment.getEnchant(), 3));
                yield boots;
            }
        };
    }

    private ItemStack namedItem(String id, String materialName, String name, String lore, int armor,
                                double toughness, double knockback) {
        return namedItem(id, materialName, name, new String[]{lore}, armor, toughness, knockback, EquipmentSlot.HAND);
    }

    private ItemStack namedItem(String id, String materialName, String name, String lore1, String lore2,
                                int armor, double toughness, double knockback) {
        return namedItem(id, materialName, name, new String[]{lore1, lore2}, armor, toughness, knockback, EquipmentSlot.HAND);
    }

    private ItemStack namedItem(String id, String materialName, String name, String lore1, String lore2,
                                String lore3, String lore4, int armor, double toughness, double knockback) {
        return namedItem(id, materialName, name, new String[]{lore1, lore2, lore3, lore4}, armor, toughness, knockback, EquipmentSlot.HAND);
    }

    private ItemStack namedItem(String id, String materialName, String name, String lore1, String lore2,
                                String lore3, String lore4, String lore5, int armor, double toughness, double knockback) {
        return namedItem(id, materialName, name, new String[]{lore1, lore2, lore3, lore4, lore5}, armor, toughness, knockback, EquipmentSlot.HAND);
    }

    private ItemStack namedItem(String id, String materialName, String name, String lore1, String lore2,
                                String lore3, String lore4, String lore5, String lore6, int armor,
                                double toughness, double knockback, EquipmentSlot slot) {
        return namedItem(id, materialName, name, new String[]{lore1, lore2, lore3, lore4, lore5, lore6}, armor, toughness, knockback, slot);
    }

    private ItemStack namedItem(String id, String materialName, String name, String[] lore,
                                int armor, double toughness, double knockback, EquipmentSlot slot) {
        Material material = material(materialName);
        if (material == air()) {
            getLogger().warning("Could not resolve material " + materialName + " for item " + id);
            return new ItemStack(material);
        }
        ItemStack item = new ItemStack(material);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(color(name));
        meta.setLore(java.util.Arrays.stream(lore).map(this::color).toList());
        meta.getPersistentDataContainer().set(itemIdKey, PersistentDataType.STRING, id);
        XItemFlag.of("HIDE_ATTRIBUTES").ifPresent(flag -> flag.set(meta));
        if (armor > 0) {
            XAttribute.of("ARMOR").ifPresent(attribute -> meta.addAttributeModifier(attribute.get(),
                    XAttribute.createModifier("kodari:" + id + "_armor", armor, AttributeModifier.Operation.ADD_NUMBER, slot)));
        }
        if (toughness > 0) {
            XAttribute.of("ARMOR_TOUGHNESS").ifPresent(attribute -> meta.addAttributeModifier(attribute.get(),
                    XAttribute.createModifier("kodari:" + id + "_toughness", toughness, AttributeModifier.Operation.ADD_NUMBER, slot)));
        }
        if (knockback > 0) {
            XAttribute.of("KNOCKBACK_RESISTANCE").ifPresent(attribute -> meta.addAttributeModifier(attribute.get(),
                    XAttribute.createModifier("kodari:" + id + "_knockback", knockback, AttributeModifier.Operation.ADD_NUMBER, slot)));
        }
        item.setItemMeta(meta);