p8rziv4l

make a scythe, that gives the lunge effect a spear with lunge 3 has, give it a 3 quick slash attack

Kodari AI
KodariNov 14 at 7:13 am 2
ScytheLungeSlash
A Minecraft plugin that adds a custom scythe weapon with a unique combat mechanic. The scythe provides a three-hit quick slash attack when used, and also grants the Lunge effect (similar to a spear with Lunge 3) that propels the player forward during the attack. The plugin registers a custom item, handles right-click and left-click combat interactions, applies the lunge velocity boost, and manages cooldowns to balance the rapid slashes. It integrates with the existing Lunge effect system to ensure compatibility and provides configurable damage and cooldown values.

Created the Lunge Scythe. Use /scythe to get it, then right-click to launch forward and perform three quick slashes. The ability has a 3-second cooldown.

p8rziv4l

make it able to oneshot a player in maxed diamond gear, and rename the plugin and the scythe to "Death's finger"

Kodari AI
KodariNov 14 at 7:18 am 1
  1. Increase each slash’s damage enough to defeat a player in maxed diamond armor.

  2. Rename the plugin and item to Death’s finger.

  • Renamed the scythe to Death’s finger and the plugin to DeathsFinger for plugin-name compatibility.

  • Increased slash damage enough to one-shot a player in fully enchanted diamond armor. Existing scythes will still work.

p8rziv4l

verity

Kodari AI
KodariNov 14 at 7:38 am 1

Verified: each slash deals 1,000 base damage, enough to one-shot a full-health player in Protection IV diamond armor under normal Minecraft damage rules.

The target must be in range and in front of you; other plugins can cancel or modify the damage. The item is named Death’s finger, and the plugin is registered as DeathsFinger.

p8rziv4l

change the item name to scythe, and make it to wear if some names a netherite hoe purple, and if 8 random player heads surround it in a crafting table it crafts but only one can be crafted

Kodari AI
KodariNov 14 at 7:41 am 1
  1. Rename the item to Scythe.

  2. Add the player-head recipe and enforce a server-wide limit of one craft.

  • Renamed the item Scythe.

  • Craft it by surrounding a netherite hoe named purple with eight player heads.

  • Only one can be crafted per server, even after a restart. Shift-click crafting is disabled for the recipe.

The /scythe command can still give additional copies.

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

import com.cryptomorin.xseries.XMaterial;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
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.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.PrepareItemCraftEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.CraftingInventory;
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.Vector;

public final class LungeScythePlugin extends JavaPlugin implements Listener {
    private final Map<UUID, Long> cooldowns = new HashMap<>();
    private NamespacedKey scytheKey;
    private NamespacedKey recipeKey;

    @Override
    public void onEnable() {
        scytheKey = new NamespacedKey("lungescythe", "lunge_scythe");
        recipeKey = new NamespacedKey(this, "scythe");
        Material head = XMaterial.matchXMaterial("PLAYER_HEAD").map(XMaterial::parseMaterial).orElse(null);
        Material hoe = XMaterial.matchXMaterial("NETHERITE_HOE").map(XMaterial::parseMaterial).orElse(null);
        ItemStack result = createScythe();
        if (head != null && hoe != null && result != null) {
            ShapedRecipe recipe = new ShapedRecipe(recipeKey, result);
            recipe.shape("HHH", "HSH", "HHH");
            recipe.setIngredient('H', head);
            recipe.setIngredient('S', hoe);
            getServer().addRecipe(recipe);
        }
        getServer().getPluginManager().registerEvents(this, this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }
        Player player = (Player) sender;
        ItemStack scythe = createScythe();
        if (scythe == null) {
            player.sendMessage(ChatColor.RED + "The scythe material is unavailable on this server.");
            return true;
        }
        player.getInventory().addItem(scythe).values()
                .forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
        return true;
    }

    private ItemStack createScythe() {
        ItemStack scythe = XMaterial.matchXMaterial("NETHERITE_HOE")
                .map(XMaterial::parseItem).orElse(null);
        if (scythe == null) {
            return null;
        }
        ItemMeta meta = scythe.getItemMeta();
        meta.setDisplayName(ChatColor.DARK_PURPLE + "Scythe");
        meta.setLore(Arrays.asList(ChatColor.GRAY + "Right-click to lunge forward",
                ChatColor.GRAY + "and strike three times in quick succession."));
        meta.getPersistentDataContainer().set(scytheKey, PersistentDataType.BYTE, (byte) 1);
        scythe.setItemMeta(meta);
        return scythe;
    }

    private boolean isScytheRecipe(org.bukkit.inventory.Recipe recipe) {
        return recipe instanceof ShapedRecipe && ((ShapedRecipe) recipe).getKey().equals(recipeKey);
    }

    private boolean canCraftScythe(CraftingInventory inventory) {
        if (getConfig().getBoolean("scythe-crafted")) {
            return false;
        }
        ItemStack[] matrix = inventory.getMatrix();
        if (matrix.length != 9 || matrix[4] == null || !matrix[4].hasItemMeta()) {
            return false;
        }
        ItemMeta meta = matrix[4].getItemMeta();
        return meta.hasDisplayName() && "purple".equalsIgnoreCase(ChatColor.stripColor(meta.getDisplayName()));
    }

    @EventHandler
    public void onPrepareCraft(PrepareItemCraftEvent event) {
        if (isScytheRecipe(event.getRecipe()) && !canCraftScythe(event.getInventory())) {
            event.getInventory().setResult(null);
        }
    }

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onCraft(CraftItemEvent event) {
        if (!isScytheRecipe(event.getRecipe())) {
            return;
        }
        if (!canCraftScythe(event.getInventory()) || event.isShiftClick()) {
            event.setCancelled(true);
            return;
        }
        getConfig().set("scythe-crafted", true);
        saveConfig();
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        if (event.getHand() != EquipmentSlot.HAND ||
                (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)) {
            return;
        }
        ItemStack item = event.getItem();
        if (item == null || !item.hasItemMeta() || !item.getItemMeta().getPersistentDataContainer()
                .has(scytheKey, PersistentDataType.BYTE)) {
            return;
        }
        event.setCancelled(true);
        Player player = event.getPlayer();
        long now = System.currentTimeMillis();
        if (cooldowns.getOrDefault(player.getUniqueId(), 0L) > now) {
            return;
        }
        cooldowns.put(player.getUniqueId(), now + 3000L);
        Vector direction = player.getLocation().getDirection().normalize();
        player.setVelocity(direction.multiply(1.8));
        for (int i = 0; i < 3; i++) {
            getServer().getScheduler().runTaskLater(this, () -> slash(player), i * 3L);
        }
    }

    private void slash(Player player) {
        if (!player.isOnline() || player.isDead()) {
            return;
        }
        Vector facing = player.getLocation().getDirection().normalize();
        for (Entity entity : player.getNearbyEntities(3.0, 2.0, 3.0)) {
            if (!(entity instanceof LivingEntity) || entity == player || entity.isDead()) {
                continue;
            }
            Vector offset = entity.getLocation().toVector().subtract(player.getLocation().toVector());
            if (offset.lengthSquared() <= 9.0 &&
                    (offset.lengthSquared() < 0.01 || facing.dot(offset.normalize()) >= 0.25)) {
                LivingEntity target = (LivingEntity) entity;
                target.setNoDamageTicks(0);
                target.damage(1000.0, player);
            }
        }
        player.swingMainHand();
    }
}