not_cvr

Create a fully working Minecraft Java plugin called E-Stone Sword for Paper/Spigot 1.21.x servers. Use a vanilla sword with no custom textures or resource packs. Make it extremely OP, dealing 5 hearts of damage even to players wearing full Netherite Armor. Right-click: strike enemies with lightning. Left-click: shoot a fast arrow at distant enemies; at close range, create a powerful ground-shattering crater effect. Add particle effects, sounds, configurable damage and cooldowns. Include all required Java files, plugin.yml, config.yml and pom.xml. Keep the code simple, compile-ready, and free of errors. Build the actual downloadable EStoneSword.jar if compilation is supported.

Kodari AI
KodariOct 26 at 2:03 pm 1
EStoneSword
E-Stone Sword is a powerful Minecraft plugin that adds an extremely overpowered vanilla sword to your server. The sword deals 5 hearts of damage even against players in full Netherite armor. Right-clicking strikes enemies with lightning bolts, while left-clicking shoots fast arrows at distant targets or creates a devastating ground-shattering crater effect at close range. Features configurable damage and cooldowns, with immersive particle effects and sounds for every action. Perfect for PvP arenas, minigames, or admin tools.

I’ll create the plugin entry point, vanilla E-Stone Sword abilities, configurable effects/cooldowns, and the Paper/Spigot 1.21.x Maven metadata.

Created the E-Stone Sword plugin with a vanilla Netherite Sword (Diamond Sword fallback), /estonesword, lightning on right-click, a fast custom arrow at range, and a visual crater with area damage up close. Damage is applied directly to health, so the default 10 damage (5 hearts) bypasses armor; absorption is consumed first. Damage, cooldowns, ranges, projectile speed, and messages are configurable.

The source and Maven files are in place. I can’t produce a downloadable JAR directly in this response. To build it in Kodari, click Compile in the top bar (or ⋮ → Compile Project on mobile), then click Compile and use Download when the build succeeds.

not_cvr

Create a fully working Minecraft Java plugin called E-Stone Sword for Paper/Spigot 1.21.x servers. Use a vanilla sword with no custom textures or resource packs. Make it extremely OP, dealing 5 hearts of damage even to players wearing full Netherite Armor. Right-click: strike enemies with lightning. Left-click: shoot a fast arrow at distant enemies; at close range, create a powerful ground-shattering crater effect. Add particle effects, sounds, configurable damage and cooldowns. Include all required Java files, plugin.yml, config.yml and pom.xml. Keep the code simple, compile-ready, and free of errors. Build the actual downloadable EStoneSword.jar if compilation is supported.

Kodari AI
KodariOct 26 at 2:05 pm 1
  • Check the existing plugin files and build metadata.

  • Fix any compile or behavior gaps against the requested sword abilities.

  • Keep the vanilla sword and configurable damage, cooldowns, and effects.

Updated the left-click handling so sword swings trigger the close-range crater even when aimed at an enemy; left-clicks with the sword also won’t start breaking blocks. The default 10 damage equals 5 hearts and bypasses armor.

To build and download EStoneSword.jar, click Compile in the top bar (mobile: ⋮ → Compile Project), then click Compile in the window and Download when it succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
4 374
src/main/java/com/kodari/estonedword/EStoneSwordPlugin.java
package com.kodari.estonedword;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
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.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerAnimationEvent;
import org.bukkit.event.player.PlayerAnimationType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;

public final class EStoneSwordPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private NamespacedKey swordKey;
    private NamespacedKey arrowKey;
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();

    @Override
    public void onEnable() {
        saveDefaultConfig();
        swordKey = new NamespacedKey(this, "e_stone_sword");
        arrowKey = new NamespacedKey(this, "e_stone_arrow");
        Bukkit.getPluginManager().registerEvents(this, this);
        if (getCommand("estonesword") != null) {
            getCommand("estonesword").setExecutor(this);
        }
    }

    @Override
    public void onDisable() {
        cooldowns.clear();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can receive the E-Stone Sword.");
            return true;
        }
        if (!player.hasPermission("estonesword.give")) {
            player.sendMessage(ChatColor.RED + "You do not have permission to use this command.");
            return true;
        }

        ItemStack sword = createSword();
        if (sword == null) {
            player.sendMessage(ChatColor.RED + "Could not create the sword on this server version.");
            return true;
        }
        Map<Integer, ItemStack> leftovers = player.getInventory().addItem(sword);
        leftovers.values().forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
        player.sendMessage(color(getConfig().getString("messages.received", "&aYou received the E-Stone Sword.")));
        return true;
    }

    @EventHandler
    public void onSwordUse(PlayerInteractEvent event) {
        if (event.getHand() != EquipmentSlot.HAND || !isEStoneSword(event.getItem())) {
            return;
        }

        Player player = event.getPlayer();
        Action action = event.getAction();
        if (action == Action.RIGHT_CLICK_AIR || action == Action.RIGHT_CLICK_BLOCK) {
            event.setCancelled(true);
            LivingEntity target = findTarget(player, getConfig().getDouble("range.lightning", 24.0));
            if (target == null) {
                player.sendMessage(color(getConfig().getString("messages.no-target", "&cNo target is in range.")));
                return;
            }
            if (!consumeCooldown(player, "lightning", "cooldowns.lightning-seconds")) {
                return;
            }
            Location impact = target.getLocation();
            player.getWorld().strikeLightningEffect(impact);
            damageDirectly(target, getConfig().getDouble("damage.lightning", 10.0));
            spawnImpact(impact, true);
            playSound("ENTITY_LIGHTNING_BOLT_THUNDER", player);
            return;
        }
        if (action == Action.LEFT_CLICK_AIR || action == Action.LEFT_CLICK_BLOCK) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onSwordSwing(PlayerAnimationEvent event) {
        Player player = event.getPlayer();
        if (event.getAnimationType() != PlayerAnimationType.ARM_SWING
                || !isEStoneSword(player.getInventory().getItemInMainHand())) {
            return;
        }

        LivingEntity closeTarget = findTarget(player, getConfig().getDouble("range.crater", 5.0));
        if (closeTarget != null) {
            if (consumeCooldown(player, "crater", "cooldowns.crater-seconds")) {
                createCrater(player, closeTarget);
            }
        } else if (consumeCooldown(player, "arrow", "cooldowns.arrow-seconds")) {
            shootArrow(player);
        }
    }

    @EventHandler
    public void onCustomArrowDamage(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Arrow arrow)
                || !arrow.getPersistentDataContainer().has(arrowKey, PersistentDataType.BYTE)) {
            return;
        }

        event.setCancelled(true);
        if (event.getEntity() instanceof LivingEntity target
                && arrow.getShooter() instanceof Player shooter
                && target != shooter) {
            damageDirectly(target, getConfig().getDouble("damage.arrow", 10.0));
            spawnImpact(target.getLocation(), false);
            playSound("ENTITY_ARROW_HIT_PLAYER", shooter);
        }
        arrow.remove();
    }

    @EventHandler
    public void onCustomArrowHit(ProjectileHitEvent event) {
        if (event.getEntity() instanceof Arrow arrow
                && arrow.getPersistentDataContainer().has(arrowKey, PersistentDataType.BYTE)) {
            arrow.remove();
        }
    }

    private ItemStack createSword() {
        ItemStack sword = XMaterial.matchXMaterial("NETHERITE_SWORD")
                .map(XMaterial::parseItem)
                .orElseGet(() -> XMaterial.matchXMaterial("DIAMOND_SWORD").map(XMaterial::parseItem).orElse(null));
        if (sword == null) {
            return null;
        }
        ItemMeta meta = sword.getItemMeta();
        if (meta == null) {
            return null;
        }
        meta.setDisplayName(ChatColor.AQUA + "" + ChatColor.BOLD + "E-Stone Sword");
        meta.setLore(List.of(
                ChatColor.GRAY + "Right-click: lightning strike",
                ChatColor.GRAY + "Left-click: arrow or crater"
        ));
        meta.setUnbreakable(true);
        meta.getPersistentDataContainer().set(swordKey, PersistentDataType.BYTE, (byte) 1);
        sword.setItemMeta(meta);
        return sword;
    }

    private boolean isEStoneSword(ItemStack item) {
        if (item == null || !item.hasItemMeta()) {
            return false;
        }
        ItemMeta meta = item.getItemMeta();
        return meta != null && meta.getPersistentDataContainer().has(swordKey, PersistentDataType.BYTE);
    }

    private LivingEntity findTarget(Player player, double range) {
        Location eye = player.getEyeLocation();
        Vector direction = eye.getDirection().normalize();
        RayTraceResult result = player.getWorld().rayTraceEntities(
                eye,
                direction,
                Math.max(0.0, range),
                0.8,
                entity -> entity instanceof LivingEntity && entity != player && entity.isValid() && !entity.isDead()
        );
        return result != null && result.getHitEntity() instanceof LivingEntity living ? living : null;
    }

    private void shootArrow(Player player) {
        Vector direction = player.getEyeLocation().getDirection().normalize();
        Location spawn = player.getEyeLocation().add(direction.clone().multiply(0.7));