Uzii on fire
πŸ“Ž 1 file 2,214 chars
πŸ“„
pasted-code-1789188469158.txt
txt 48 lines
β–Ά
Create an illegal Minecraft weapon called **"Scythe"** using the existing Scythe texture pack.

### Texture

* Use the provided texture pack's existing Scythe texture.
* The texture pack works by renaming a **Netherite Sword** to exactly **"Scythe"**.
* Do NOT create a new custom model if the provided texture pack already handles the Scythe texture.
* Make sure the plugin gives/recognizes the Netherite Sword named **Scythe** correctly.
* Normal Netherite Swords must remain completely unaffected.

### Scythe Damage Mechanics

The Scythe should have special damage behavior:

1. **Player with no armor**

   * A single successful Scythe hit should instantly kill the player.

2. **Player wearing full enchanted Netherite armor**

   * It should take exactly **4 normal Scythe hits** to kill them at full health.
   * The damage should work consistently regardless of normal protection enchantments.

3. **Falling Attack / Execution**

   * If the Scythe user attacks a player while falling from **10 blocks or higher**, the attack becomes an execution attack.
   * This attack should **instantly kill the target**, even if they have full enchanted Netherite armor.
   * The 10-block requirement should be based on the attacker's actual falling distance immediately before the hit.
   * Do not trigger this ability when the player is standing on the ground or falling less than 10 blocks.

### Death Effect

Whenever a player is killed by the Scythe:

* Create a dramatic **lightning strike at the victim's death location**.
* Play an appropriate thunder/lightning sound.
* Lightning should be **visual only** and must NOT cause additional damage.
* Do not create extra chain-lightning or unnecessary effects.

### Important

* The Scythe must only affect the weapon named exactly **"Scythe"**.
* Normal Netherite Swords must work normally.
* Prevent the Scythe's custom damage from stacking with itself and accidentally causing inconsistent damage.
* Make the mechanics compatible with **Minecraft 1.21.11**.
* Keep the implementation optimized and server-friendly.
* Make sure PvP damage, armor calculation, death detection, and lightning effects work reliably.
Kodari AI
KodariSep 12 at 4:52 am 1
ScytheWeapon
A Minecraft 1.21.11 plugin that implements an illegal Scythe weapon using a Netherite Sword renamed to "Scythe". The plugin detects hits from this specific weapon and applies custom damage mechanics: unarmored players die in one hit, fully enchanted Netherite armor requires exactly 4 hits, and falling from 10+ blocks triggers an execution attack that instantly kills any target. Damage bypasses normal protection enchantments while remaining consistent and non-stacking. Upon Scythe kills, a visual-only lightning strike with thunder sound occurs at the victim's location without additional damage. Normal Netherite Swords remain completely unaffected, and the implementation is optimized for server performance.
Uzii on fire
πŸ“Ž 1 file 3,486 chars
πŸ“„
pasted-code-1789189060418.txt
txt 103 lines
β–Ά
The plugin currently loads successfully, but the Scythe has NONE of the requested abilities. Fix the implementation instead of only registering the weapon.

IMPORTANT: The following mechanics MUST actually trigger in-game and must be tested.

### 1. Scythe Detection

* Only a Netherite Sword named exactly `Scythe` should activate these mechanics.
* Detect the item reliably from the player's main hand.
* The existing Scythe resource pack handles the visual texture when the Netherite Sword is named `Scythe`.
* Do not require a custom item ID that would prevent the existing texture from working.

### 2. CUSTOM DAMAGE β€” MUST OVERRIDE NORMAL DAMAGE

Do NOT simply add damage to the normal Netherite Sword attack.

When a player attacks another player with the Scythe, cancel/override the normal damage event and apply the custom Scythe damage.

The target's armor and enchantments must NOT make the damage inconsistent.

Required behavior at full health:

* Target has NO armor β†’ 1 Scythe hit kills them.
* Target has full enchanted Netherite armor β†’ exactly 4 normal Scythe hits kill them.

Make the damage values deterministic and consistent.

### 3. FALLING EXECUTION

This ability is separate from normal Scythe damage.

When the Scythe wielder attacks while falling:

* Check the attacker's actual falling distance immediately before the hit.
* If falling distance is `>= 10 blocks`, activate EXECUTION.
* The target is instantly killed regardless of armor, Protection enchantments, or other normal damage reduction.
* This must work against a player wearing full enchanted Netherite armor.
* Do NOT require the attacker to land on the ground first.
* The Scythe attack itself must trigger the execution when the hit connects.

Example:
Player jumps from 10+ blocks β†’ falls toward target β†’ hits target with Scythe β†’ target dies instantly.

### 4. DEATH LIGHTNING

Whenever the Scythe causes a player to die:

* Strike lightning at the victim's exact death location.
* Lightning must be visual/effect only.
* Lightning must NOT cause additional damage.
* Play the normal lightning/thunder effect.
* It should happen immediately when the Scythe kill occurs.

### 5. IMPORTANT EVENT HANDLING

Make sure the implementation works with Bukkit/Paper's PvP damage events.

Do not rely only on:

* item lore
* commands
* passive checks
* attack animation
* resource-pack detection

The actual hit event must trigger the abilities.

Handle:

* EntityDamageByEntityEvent
* player-vs-player attacks
* custom damage
* death detection
* falling distance
* lightning effect

Prevent the normal Netherite Sword damage from being applied in addition to the custom damage.

### 6. DEBUG / TESTING

Add temporary console debug messages or logging so we can verify:

`[Scythe] Attack detected`
`[Scythe] Target armor: ...`
`[Scythe] Normal damage applied`
`[Scythe] Execution triggered`
`[Scythe] Scythe kill detected`
`[Scythe] Lightning spawned`

After confirming everything works, make debug logging configurable or disabled by default.

### 7. COMPATIBILITY

Target:

* Minecraft 1.21.11
* Paper/Spigot-compatible API appropriate for 1.21.11

The final plugin must not just load successfully β€” ALL THREE gameplay mechanics must be functional in an actual PvP test:

1. No armor = 1 hit kill
2. Full enchanted Netherite = 4 hits
3. 10+ block falling Scythe hit = instant execution + lightning
Kodari AI
KodariSep 12 at 5:00 am 1
  1. Inspect the current plugin entrypoint and build metadata.

  2. Replace the registration-only implementation with event-driven Scythe detection and deterministic custom damage.

  3. Add falling execution, visual-only death lightning, and configurable debug logging.

  4. Keep normal Netherite Swords unaffected and align the implementation with the 1.21.11 API.

  1. Replaced registration-only behavior with EntityDamageByEntityEvent handling at high priority.

  2. Scythe detection now requires a Netherite Sword named exactly Scythe.

  3. Normal Scythe hits:

    • No armor: instant kill.

    • Any armor: deterministic damage equal to 25% max health, resulting in exactly 4 hits from full health.

    • Normal sword damage is cancelled and cannot stack.

  4. Falling execution triggers when the attacker is airborne with fallDistance >= 10.

  5. Scythe kills now create visual-only lightning and thunder at the victim’s death location.

  6. Added configurable debug logging in src/main/resources/config.yml:

YAML
debug: false

Set debug: true to log attack detection, armor state, normal damage, executions, kills, and lightning creation.

Uzii on fire
πŸ“Ž 1 file 2,730 chars
πŸ“„
pasted-code-1789189695608.txt
txt 79 lines
β–Ά
Fix the existing Scythe plugin according to these EXACT mechanics.

## WEAPON

* Base item: Netherite Sword.
* Item name: **Scythe**
* The name must be **BOLD RGB / animated gradient**.
* Enchantment: **Sharpness VI**.
* Keep compatibility with the provided Scythe texture pack, which changes the Netherite Sword texture when named `Scythe`.

## NORMAL COMBAT

The Scythe must behave exactly like a normal Minecraft sword during normal combat.

* Normal attack mechanics.
* Normal attack cooldown.
* Reliable hit registration.
* No random missed hits.
* No special movement required.
* The player can attack normally while standing on the ground.
* Do NOT make every normal hit an instant kill.

The Scythe should simply deal **much higher damage than a normal Netherite Sword**.

For a player wearing full enchanted Netherite armor, approximately **4 normal hits** should be enough to kill them from full health.

Armor and Protection enchantments should still function normally.

## HEIGHT EXECUTION ABILITY

Keep the special height-based ability.

When the Scythe user attacks another player while falling from **10 blocks or higher**:

* Trigger the Scythe's **Execution** ability.
* Instantly kill the target regardless of their armor, Protection enchantments, or health.
* This should only activate when the attacker's falling distance is **10+ blocks** at the moment the attack successfully connects.
* Falling from less than 10 blocks must NOT trigger Execution.
* A normal ground attack must NEVER trigger Execution.
* Do not permanently store falling distance; check the actual current fall/attack state so the ability cannot randomly trigger later.

Example:

`Jump from 10+ blocks β†’ fall toward player β†’ hit player with Scythe β†’ instant kill.`

## LIGHTNING DEATH EFFECT

Whenever the Scythe kills a player:

* Spawn a lightning strike at the victim's death location.
* Lightning is **visual/effect only** and must not cause additional damage.
* Play the normal lightning/thunder effect.
* Trigger it only when the Scythe is responsible for the kill.

## LORE

Add this short description to the item:

`A forbidden blade forged to deal devastating damage.`

Keep the lore short and clean.

## REMOVE BUGS FROM PREVIOUS VERSION

The previous version incorrectly caused normal attacks to sometimes one-shot players and sometimes fail to register.

Fix this completely.

The final behavior MUST be:

**Normal ground hit:** High sword damage
**10+ block falling hit:** Instant execution
**Scythe kill:** Lightning
**Name:** Bold RGB Scythe
**Enchantment:** Sharpness VI
**Combat:** Reliable normal sword combat

Do not add any other abilities.
Kodari AI
KodariSep 12 at 5:11 am 1
  1. Inspect the current Scythe event, item creation, and configuration.

  2. Restore vanilla-style hit handling while applying only amplified normal damage.

  3. Add exact falling execution checks, kill attribution, lightning effect, and the requested item metadata.

  4. Remove one-shot behavior from ordinary ground attacks and keep debug output configurable.

Implemented the requested Scythe behavior:

  • Normal attacks now use the regular Minecraft damage event and cooldown, with damage amplified by 3.2x.

  • Armor and Protection enchantments continue functioning normally.

  • Ground attacks no longer instantly kill players.

  • Falling execution triggers only when:

    • The attacker is airborne.

    • The attacker is descending.

    • Current fall distance is at least 10 blocks.

  • Execution cancels normal damage and instantly kills the target.

  • Scythe kills trigger visual-only lightning and thunder.

  • Scythe item now has:

    • Animated bold RGB gradient name.

    • Sharpness VI.

    • Lore: A forbidden blade forged to deal devastating damage.

  • Detection remains limited to Netherite Swords whose plain-text name is exactly Scythe.

  • Normal Netherite Swords are unaffected.

  • Configurable debug logging remains available through config.yml.

Uzii on fire

Fix the Scythe's visual/model glitch.

The Scythe currently rapidly moves up and down while being held/used. It looks like the item is shaking or bouncing extremely fast.

DO NOT change any of the existing Scythe gameplay mechanics. The following are already working correctly and must remain exactly the same:

* Normal high sword damage * 10+ block falling execution * Lightning on Scythe kills * Sharpness VI * Bold RGB Scythe name * Normal sword hit registration

ONLY fix the visual/model issue.

Visual Fix

* Stop the Scythe from rapidly moving up and down. * Remove any custom animation, bobbing, shaking, position loop, or transformation that is causing the rapid movement. * The Scythe should behave visually like a normal Minecraft Netherite Sword when held. * Keep the Scythe model/texture exactly the same. * Do NOT change the texture itself. * Do NOT add any new animation. * Do NOT continuously modify the item's display position, rotation, scale, or transformation every tick. * Make sure the plugin is not repeatedly updating the item's model data, item meta, or display transformation every tick. * The RGB item-name animation may remain, but it must NOT modify the physical item model or cause the Scythe to visually shake.

Important

Check for conflicts between:

* Resource-pack item model transforms * CustomModelData / item model data * Item display transformations * Plugin tick tasks * Repeated ItemMeta updates * Animation code

The final Scythe should stay visually stable in the player's hand with no rapid up/down movement or shaking.

Do not modify any working combat abilities.

Kodari AI
KodariSep 12 at 5:21 am 1
  1. Remove the repeating Scythe inventory update task causing the visual shake.

  2. Keep the item’s bold RGB name, texture-compatible Netherite Sword base, enchantment, lore, and all combat handlers unchanged.

  3. Create the name once when the item is given instead of rewriting ItemMeta every few ticks.

Removed the repeating inventory/item-meta animation task that caused the Scythe to shake or bounce.

The Scythe now:

  • Uses a stable item model like a normal Netherite Sword.

  • Keeps the existing texture, bold RGB name, Sharpness VI, and lore.

  • Does not repeatedly modify item metadata or model data.

  • Preserves all existing combat, execution, lightning, and hit-registration mechanics.

Uzii on fire

Add BOTH of these features to the existing Scythe plugin. Do not change or remove any existing Scythe mechanics.

1. SCYTHE OWNER β€” 30 HEARTS

The player who currently possesses the Scythe should receive:

* 30 hearts = 60 HP maximum health * Players without the Scythe remain at the normal 10 hearts = 20 HP.

Requirements

* When a player obtains the Scythe, immediately give them 60 maximum HP. * When they lose the Scythe, immediately return them to 20 maximum HP. * If their current health is above 20 HP when they lose the Scythe, safely reduce it to 20 HP. * The bonus must NOT stack when moving the Scythe between inventory slots. * Reconnecting or restarting the server must NOT duplicate the health bonus. * Only the actual Scythe owner should receive the 30-heart bonus.

2. COLORFUL SCYTHE PARTICLES

While the player is holding the Scythe, make colorful particles continuously come directly from the Scythe/blade.

* Use a smooth RGB/rainbow color cycle. * Colors can transition between red, purple, blue, cyan, green, yellow, and pink. * Particles should originate around the Scythe blade, not around the player's entire body. * Keep the particle amount moderate and optimized. * Make them slowly float outward and disappear quickly. * The particles should follow the Scythe naturally while the player moves. * No excessive particle spam or server lag. * Do NOT make the particles cause damage or any gameplay effect. * Do NOT make the Scythe shake, bounce, or rapidly move up/down. * Do NOT change the existing Scythe texture or model.

KEEP ALL EXISTING MECHANICS

Do not break or modify these already-working features:

* Normal Scythe attack = high damage * 10+ block falling attack = instant execution * Scythe kill = lightning effect * Sharpness VI * Bold RGB "Scythe" name * Scythe texture compatibility * Normal reliable sword hit registration * Stable Scythe visual/model

The final result should make the Scythe feel like a rare, forbidden legendary weapon with 30 hearts for its owner and a subtle colorful aura coming directly from the blade.

Kodari AI
KodariSep 12 at 5:26 am 1
  1. Add idempotent Scythe-owner health synchronization for acquisition, loss, reconnect, and restart scenarios.

  2. Add a lightweight repeating blade-local RGB particle effect without modifying item metadata or display transformations.

  3. Preserve all existing combat, item, execution, lightning, and visual stability behavior.

Implemented both features without changing existing Scythe mechanics:

  • Scythe owners now receive 60 maximum health / 30 hearts.

  • Health updates when the Scythe is:

    • Added or picked up

    • Dropped

    • Moved between inventory slots

    • Present after reconnecting or restarting

    • Restored after respawn

  • Losing the Scythe returns the player to 20 maximum health, safely clamping current health if necessary.

  • The health bonus is idempotent and does not stack.

Added optimized blade particles:

  • Smooth RGB/rainbow Dust particle cycle.

  • Particles spawn near the held Scythe blade while it is in the main hand.

  • Moderate rate: two particles every two ticks.

  • Small spread and quick disappearance.

  • No damage or gameplay effects.

  • No item metadata, model data, display transformation, or animation updates.

  • Existing combat, execution, lightning, Sharpness VI, name, texture, and hit registration remain unchanged.

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

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XAttribute;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import net.kyori.adventure.text.format.TextColor;
import net.kyori.adventure.text.format.TextDecoration;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.util.Vector;
import org.bukkit.scheduler.BukkitTask;

import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;

public final class ScythePlugin extends JavaPlugin implements Listener {
    private static final String SCYTHE_NAME = "Scythe";
    private static final double NORMAL_DAMAGE_MULTIPLIER = 3.2D;
    private static final double EXECUTION_FALL_DISTANCE = 10.0D;
    private static final double SCYTHE_OWNER_HEALTH = 60.0D;
    private static final double DEFAULT_HEALTH = 20.0D;

    private final Set<UUID> scytheKills = new HashSet<>();
    private final Set<UUID> scytheOwners = new HashSet<>();
    private BukkitTask scytheTask;
    private Particle dustParticle;
    private int particleFrame;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        getServer().getPluginManager().registerEvents(this, this);

        XParticle.of("DUST").ifPresent(particle -> dustParticle = particle.get());

        for (Player player : Bukkit.getOnlinePlayers()) {
            syncOwnerHealth(player);
        }

        scytheTask = Bukkit.getScheduler().runTaskTimer(this, this::updateScythePlayers, 1L, 2L);

        if (getCommand("scythe") != null) {
            getCommand("scythe").setExecutor(this);
        }
    }

    @Override
    public void onDisable() {
        if (scytheTask != null) {
            scytheTask.cancel();
        }

        for (Player player : Bukkit.getOnlinePlayers()) {
            setMaximumHealth(player, DEFAULT_HEALTH);
        }

        scytheOwners.clear();
    }

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void onScytheAttack(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player attacker)
                || !(event.getEntity() instanceof Player victim)
                || !isScythe(attacker.getInventory().getItemInMainHand())
                || victim.isDead()) {
            return;
        }

        debug("Attack detected: " + attacker.getName() + " -> " + victim.getName());

        int armorPieces = countArmorPieces(victim);
        debug("Target armor: " + armorPieces + "/4 pieces (" + victim.getName() + ")");

        boolean execution = !attacker.isOnGround()
                && attacker.getFallDistance() >= EXECUTION_FALL_DISTANCE
                && attacker.getVelocity().getY() <= 0.0D;

        if (execution) {
            event.setCancelled(true);
            victim.setLastDamageCause(event);
            victim.setKiller(attacker);
            debug("Execution triggered: " + attacker.getName()
                    + " was falling " + attacker.getFallDistance() + " blocks");
            killWithScythe(victim);
            return;
        }

        double damage = event.getDamage() * NORMAL_DAMAGE_MULTIPLIER;
        event.setDamage(damage);
        debug("Normal damage applied: " + damage + " to " + victim.getName());
    }

    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
    public void trackScytheKill(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player attacker)
                || !(event.getEntity() instanceof Player victim)
                || !isScythe(attacker.getInventory().getItemInMainHand())
                || victim.isDead()) {
            return;
        }

        double totalHealth = victim.getHealth() + victim.getAbsorptionAmount();
        if (event.getFinalDamage() >= totalHealth) {
            scytheKills.add(victim.getUniqueId());
        }
    }

    @EventHandler
    public void onScytheDeath(PlayerDeathEvent event) {
        Player victim = event.getEntity();

        if (!scytheKills.remove(victim.getUniqueId())) {
            return;
        }

        Location location = victim.getLocation().clone();
        World world = location.getWorld();

        if (world == null) {
            return;
        }

        world.strikeLightningEffect(location);
        debug("Lightning spawned at " + location.getBlockX() + ", "
                + location.getBlockY() + ", " + location.getBlockZ());

        XSound.matchXSound("ENTITY_LIGHTNING_BOLT_THUNDER")
                .ifPresent(sound -> world.playSound(location, sound.get(), 1.0F, 0.8F));
    }

    @Override
    public boolean onCommand(
            CommandSender sender,
            Command command,
            String label,
            String[] args
    ) {
        if (!command.getName().equalsIgnoreCase("scythe")) {
            return false;
        }

        if (!sender.hasPermission("scythe.give")) {
            sender.sendMessage("You do not have permission to use this command.");
            return true;
        }

        Player target;

        if (args.length == 0) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Usage: /scythe give <player>");
                return true;
            }

            target = player;
        } else if (args.length == 1 && args[0].equalsIgnoreCase("give")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Usage: /scythe give <player>");
                return true;
            }

            target = player;
        } else if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
            target = Bukkit.getPlayerExact(args[1]);

            if (target == null) {
                sender.sendMessage("That player is not online.");
                return true;
            }
        } else {
            sender.sendMessage("Usage: /scythe [give] [player]");
            return true;
        }