zion ragoonanan

make me a minecraft plugin with two custom weapons. they are the end scythe and the hellspire staff. the end scythe does 1.5x the damage of a netherite sword, its right click is an teleport with purple particles surrounding the player from the point of teleport to the destination, when held it gives the user speed 2. and has a csutom texture that looks like abig black and grey scythe with purple particles and conture,crouching with the end scythe creates a 1.5 area around the player of dragon's breath that doesnt dmg the user. for the hellspire staff make it a wooden stick with an red recoloured emeral ontop, its abilities include the left click shoots a fireball that deals 6 hearts of dmg to someone in prot 4 diamond armour, and the right click creates an 15 block area using particles and transforms the ground into a firey and magma place for 30 seconds, everyone insde that circle gets withering 1 except the person with the hellspire staff, the user of hellspire staff while inside the zone gains the custom effect of true fire(true fire give s the user the ability of dmging through armour its kidn of liek breach. true fire does 50% dmg through armour ) the holder of hellspire staff gets permerment fire res, also crouching creates a particle area of 1.5 blocks that even if the other player has fire res it still deals dmg but dosnt dmg the user

Kodari AI
KodariOct 9 at 6:04 am 1
EndScytheHellspire
Adds two custom weapons to Minecraft. The End Scythe deals 1.5x netherite sword damage, grants Speed II when held, right-click teleports with purple particle trail, and crouching creates a 1.5-block dragon's breath area that doesn't harm the user. The Hellspire Staff (wooden stick with red emerald) fires a 6-heart fireball on left click, right-click creates a 15-block magma zone for 30 seconds applying Wither I to enemies while granting the holder True Fire (50% armor-piercing damage) and permanent Fire Resistance, and crouching creates a damaging fire particle area bypassing fire resistance.
  1. Add the Paper plugin setup and /customweapons command to give either weapon.

  2. Implement the End Scythe’s damage, teleport, Speed II, and crouch breath ability.

  3. Implement the Hellspire Staff’s fireball, temporary magma zone, Wither, fire resistance, and True Fire damage bonus.

Created the plugin with /customweapons <player> <end|hellspire|both> and the requested weapon abilities. The fire zone restores its changed blocks after 30 seconds, unless a block was changed in the meantime.

The items have custom model data IDs, but the actual scythe and staff textures/resource-pack models aren’t included. Texture generation is currently disabled; enable it in the project’s Settings → Generation to create textures. The fireball is set to 12 damage (6 hearts) before the target’s defenses are applied.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 455
src/main/java/com/kodari/customweapons/CustomWeaponsPlugin.java
package com.kodari.customweapons;

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.World;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;
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.entity.Projectile;
import org.bukkit.entity.SmallFireball;
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.PlayerInteractEvent;
import org.bukkit.event.player.PlayerToggleSneakEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.NamespacedKey;
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.Vector;

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

public final class CustomWeaponsPlugin extends JavaPlugin implements Listener {
    private static final String SCYTHE = "end_scythe";
    private static final String STAFF = "hellspire_staff";
    private static final String FIREBALL_TAG = "hellspire_fireball";
    private static final double ZONE_RADIUS = 15.0;

    private NamespacedKey weaponKey;
    private final Set<FireZone> fireZones = new HashSet<>();

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "weapon");
        Bukkit.getPluginManager().registerEvents(this, this);
        Bukkit.getScheduler().runTaskTimer(this, this::refreshHeldEffects, 1L, 20L);
    }

    @Override
    public void onDisable() {
        for (FireZone zone : new ArrayList<>(fireZones)) {
            zone.restore();
        }
        fireZones.clear();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 2) {
            sender.sendMessage("§cUsage: /customweapons <player> <end|hellspire|both>");
            return true;
        }

        Player target = Bukkit.getPlayerExact(args[0]);
        if (target == null) {
            sender.sendMessage("§cThat player is not online.");
            return true;
        }

        String selection = args[1].toLowerCase();
        if (selection.equals("end") || selection.equals("both")) {
            target.getInventory().addItem(createWeapon(SCYTHE));
        }
        if (selection.equals("hellspire") || selection.equals("both")) {
            target.getInventory().addItem(createWeapon(STAFF));
        }
        if (!selection.equals("end") && !selection.equals("hellspire") && !selection.equals("both")) {
            sender.sendMessage("§cChoose end, hellspire, or both.");
            return true;
        }

        sender.sendMessage("§aGave the weapon to " + target.getName() + ".");
        return true;
    }

    private ItemStack createWeapon(String id) {
        String materialName = id.equals(SCYTHE) ? "NETHERITE_SWORD" : "STICK";
        ItemStack item = XMaterial.matchXMaterial(materialName)
                .map(XMaterial::parseItem)
                .orElseThrow(() -> new IllegalStateException("Missing item material: " + materialName));
        ItemMeta meta = item.getItemMeta();
        if (id.equals(SCYTHE)) {
            meta.setDisplayName("§5§lEnd Scythe");
            meta.setLore(List.of("§7A blade from beyond the End.", "§dRight-click: teleport", "§dCrouch: dragon's breath"));
            meta.setCustomModelData(10001);
        } else {
            meta.setDisplayName("§c§lHellspire Staff");
            meta.setLore(List.of("§7A staff burning with hellfire.", "§cLeft-click: fireball", "§cRight-click: 15-block fire zone"));
            meta.setCustomModelData(10002);
        }
        meta.getPersistentDataContainer().set(weaponKey, PersistentDataType.STRING, id);
        item.setItemMeta(meta);
        return item;
    }

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

    private boolean isHolding(Player player, String id) {
        return id.equals(weaponId(player.getInventory().getItemInMainHand()))
                || id.equals(weaponId(player.getInventory().getItemInOffHand()));
    }

    private void refreshHeldEffects() {
        for (Player player : Bukkit.getOnlinePlayers()) {
            if (isHolding(player, SCYTHE)) {
                applyEffect(player, "SPEED", 40, 1);
            }
            if (isHolding(player, STAFF)) {
                applyEffect(player, "FIRE_RESISTANCE", 100, 0);
            }
        }
    }

    private void applyEffect(LivingEntity entity, String effect, int duration, int amplifier) {
        XPotion.matchXPotion(effect)
                .map(potion -> potion.buildPotionEffect(duration, amplifier))
                .ifPresent(entity::addPotionEffect);
    }

    @EventHandler
    public void onWeaponUse(PlayerInteractEvent event) {
        if (event.getHand() != EquipmentSlot.HAND) {
            return;
        }
        Player player = event.getPlayer();
        String id = weaponId(event.getItem());
        if (SCYTHE.equals(id) && isRightClick(event.getAction())) {
            event.setCancelled(true);
            teleportWithScythe(player);
        } else if (STAFF.equals(id) && event.getAction() == Action.LEFT_CLICK_AIR) {
            event.setCancelled(true);
            shootFireball(player);
        } else if (STAFF.equals(id) && event.getAction() == Action.LEFT_CLICK_BLOCK) {
            event.setCancelled(true);
            shootFireball(player);
        } else if (STAFF.equals(id) && isRightClick(event.getAction())) {
            event.setCancelled(true);
            createFireZone(player);
        }
    }

    @EventHandler
    public void onCrouch(PlayerToggleSneakEvent event) {
        if (!event.isSneaking()) {
            return;
        }
        Player player = event.getPlayer();
        if (isHolding(player, SCYTHE)) {
            createBreathField(player);
        }
    }

    @EventHandler
    public void onDamage(EntityDamageByEntityEvent event) {
        Player attacker = getPlayerAttacker(event.getDamager());
        if (attacker == null) {
            return;
        }

        if (event.getDamager() instanceof Projectile projectile
                && projectile.hasMetadata(FIREBALL_TAG)) {
            event.setDamage(12.0);
        } else if (weaponId(attacker.getInventory().getItemInMainHand()) != null
                && SCYTHE.equals(weaponId(attacker.getInventory().getItemInMainHand()))
                && event.getDamager() == attacker) {
            event.setDamage(event.getDamage() * 1.5);
        }

        if (hasTrueFire(attacker)) {
            event.setDamage(event.getDamage() * 1.5);
        }
    }