Rupesh Jaswal

I need a plugin that adds 6 custom weapons to the server, with each weapon having its own unique abilities.

  1. Evoker’s Blade

Ability 1: It can release spikes from the ground. When a spike is released, it should check the ground underneath and make grass/ground particles come out from below. It can also spawn Vexes. The Vexes should not attack the player who used the weapon; they should attack other players.

  1. Honey Sword

Ability 1: It should give the player Flight for 1 minute.

Ability 2: It should allow the player to heal themselves, similar to a honey-related healing ability.

The cooldown should be 1 minute after each use.

  1. Emperor Axe

Ability 1: When the axe hits the ground, the ground should crack, and players in front of it should be launched into the air.

Ability 2: It should give the player Strength II for 1 minute.

The cooldown should be 2 minutes.

  1. Ender Blade

Ability 1: It should teleport the player to the location they are looking at.

The cooldown should be 10 seconds.

Ability 2: It should allow the player to disguise/change into another form or entity.

  1. Frosty Double-Bladed Sword

Ability 1: It should be able to freeze enemies in front of the player for 2 minutes.

Ability 2: It should give the player Frost Walker, so whenever the player walks over water, the water turns into ice.

  1. Light Hammer

Ability 1: It should be able to crack/break the ground beneath the player or in front of them.

The cooldown should be 15 seconds.

Ability 2: It should launch the player upward.

The hammer should have:

  • Wind Burst II
  • Density VII
  • Unbreaking III

It should allow the player to jump/launch themselves into the air and use the hammer to perform a powerful attack. And also make its texture

Kodari AI
KodariOct 8 at 6:03 pm 1
MythicWeaponry
A Minecraft plugin introducing six legendary custom weapons, each with unique abilities and cooldowns. The Evoker's Blade summons ground spikes and hostile Vexes. The Honey Sword grants flight and self-healing. The Emperor Axe cracks the earth, launching enemies skyward while granting Strength II. The Ender Blade teleports to targeted locations and allows entity disguise. The Frosty Double-Bladed Sword freezes enemies and provides Frost Walker. The Light Hammer cracks terrain, launches the player, and features Wind Burst II, Density VII, and Unbreaking III enchantments with custom textures.
  1. Create the Paper plugin scaffold and /customweapons give command.

  2. Implement all six weapons, their abilities, cooldowns, and temporary effects.

  3. Add the requested hammer enchantments and explain how to enable texture generation.

Created the plugin with /customweapons give <player> <weapon> and all six weapons.

  • Honey Sword: one-minute flight and healing, each with a one-minute cooldown.

  • Emperor Axe: ground quake and Strength II, each with a two-minute cooldown.

  • Ender Blade: safe teleport and a 30-second invisible Ender form; each ability has a 10-second cooldown.

  • Frosty Double-Bladed Sword: freezes enemies for two minutes and has Frost Walker.

  • Light Hammer: ground-crack effect and upward launch, each with a 15-second cooldown; landing after a launch triggers a shockwave. Includes Wind Burst II, Density VII, and Unbreaking III.

  • Evoker’s Blade: ground effects and Vexes that target other players, with a 30-second cooldown.

Ground cracks and spikes are visual effects and don’t alter terrain. The Ender form uses invisibility and portal effects rather than a full mob-model disguise.

Texture generation is disabled for this project. Enable it via Settings → Generation to create the hammer texture.

Rupesh Jaswal

Fast

Kodari AI
KodariOct 8 at 6:09 pm 1

The plugin is ready. Click Compile in the top bar, then Compile in the build window to download the jar.

Rupesh Jaswal

Resource pack

Kodari AI
KodariOct 8 at 6:10 pm 1

Texture generation is disabled for this project. Enable it in Settings → Generation (or for all projects at kodari.ai/settings?tab=features), then I can help create the weapon textures for a resource pack.

Rupesh Jaswal

I cannot find

Kodari AI
KodariOct 8 at 6:11 pm 1

Open kodari.ai/settings?tab=features and enable Texture Generation. You can also enable it just for this project via the Settings button → Generation.

Rupesh Jaswal

I enable it make the custom weapon texture pack also

Kodari AI
KodariOct 8 at 6:17 pm 21

Created the Minecraft 1.21.4 resource pack in resource-pack/ and linked its textures to the custom weapons. The project now packages it as build/distributions/customweapons-resource-pack.zip during assembly.

Five weapon textures were generated. Texture generation ran out of available credits before the Light Hammer texture, so it currently uses the vanilla mace appearance.

Kodari can make mistakes. Review important code before using.
Files
resource-pack
src
build.gradle
Code
20 670
src/main/java/com/kodari/customweapons/CustomWeaponsPlugin.java
package com.kodari.customweapons;

import com.cryptomorin.xseries.XEnchantment;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
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.World;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.entity.Vex;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.scheduler.BukkitTask;
import org.bukkit.util.Vector;

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

public final class CustomWeaponsPlugin extends org.bukkit.plugin.java.JavaPlugin implements Listener, CommandExecutor, TabCompleter {
    private static final String PREFIX = "&8[&dWeapons&8] &7";
    private static final List<String> WEAPONS = List.of(
            "evokers_blade", "honey_sword", "emperor_axe", "ender_blade", "frosty_double_blade", "light_hammer"
    );

    private NamespacedKey weaponKey;
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();
    private final Map<UUID, UUID> vexOwners = new HashMap<>();
    private final Map<UUID, BukkitTask> vexCleanupTasks = new HashMap<>();
    private final Map<UUID, Long> frozenUntil = new HashMap<>();
    private final Map<UUID, FlightState> flightStates = new HashMap<>();
    private final Map<UUID, Long> hammerLaunches = new HashMap<>();

    @Override
    public void onEnable() {
        weaponKey = new NamespacedKey(this, "custom_weapon");
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("customweapons").setExecutor(this);
        getCommand("customweapons").setTabCompleter(this);
        Bukkit.getScheduler().runTaskTimer(this, this::tickFrozenPlayers, 20L, 20L);
    }

    @Override
    public void onDisable() {
        for (Map.Entry<UUID, FlightState> entry : flightStates.entrySet()) {
            Player player = Bukkit.getPlayer(entry.getKey());
            if (player != null) {
                restoreFlight(player, entry.getValue());
            }
        }
        for (BukkitTask task : vexCleanupTasks.values()) {
            task.cancel();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length != 3 || !args[0].equalsIgnoreCase("give")) {
            sender.sendMessage(color(PREFIX + "Use: &f/customweapons give <player> <weapon>"));
            sender.sendMessage(color(PREFIX + "Weapons: &f" + String.join(", ", WEAPONS)));
            return true;
        }

        Player target = Bukkit.getPlayerExact(args[1]);
        String weapon = args[2].toLowerCase();
        if (target == null) {
            sender.sendMessage(color(PREFIX + "That player is not online."));
            return true;
        }
        if (!WEAPONS.contains(weapon)) {
            sender.sendMessage(color(PREFIX + "Unknown weapon. Use &f" + String.join(", ", WEAPONS)));
            return true;
        }

        target.getInventory().addItem(createWeapon(weapon)).values().forEach(item ->
                target.getWorld().dropItemNaturally(target.getLocation(), item));
        sender.sendMessage(color(PREFIX + "Gave &f" + weapon + " &7to &f" + target.getName() + "&7."));
        return true;
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        if (args.length == 1) {
            return startsWith(List.of("give"), args[0]);
        }
        if (args.length == 2 && args[0].equalsIgnoreCase("give")) {
            return startsWith(Bukkit.getOnlinePlayers().stream().map(Player::getName).toList(), args[1]);
        }
        if (args.length == 3 && args[0].equalsIgnoreCase("give")) {
            return startsWith(WEAPONS, args[2]);
        }
        return List.of();
    }

    @EventHandler
    public void onWeaponUse(PlayerInteractEvent event) {
        if (!event.getAction().isRightClick()) {
            return;
        }
        Player player = event.getPlayer();
        String weapon = getWeaponId(event.getItem());
        if (weapon == null) {
            return;
        }
        event.setCancelled(true);
        boolean alternate = player.isSneaking();
        switch (weapon) {
            case "evokers_blade" -> {
                if (!alternate && ready(player, "evoker_spikes", 30)) {
                    evokerSpikes(player);
                }
            }
            case "honey_sword" -> {
                if (alternate) {
                    if (ready(player, "honey_heal", 60)) {
                        honeyHeal(player);
                    }
                } else if (ready(player, "honey_flight", 60)) {
                    honeyFlight(player);
                }
            }
            case "emperor_axe" -> {
                if (alternate) {
                    if (ready(player, "emperor_strength", 120)) {
                        strength(player);
                    }
                } else if (ready(player, "emperor_quake", 120)) {
                    emperorQuake(player);
                }
            }
            case "ender_blade" -> {
                if (alternate) {
                    if (ready(player, "ender_form", 10)) {
                        enderForm(player);
                    }
                } else if (ready(player, "ender_teleport", 10)) {
                    enderTeleport(player);
                }
            }
            case "frosty_double_blade" -> {
                if (!alternate && ready(player, "frost_freeze", 60)) {
                    freezeEnemies(player);
                }
            }
            case "light_hammer" -> {
                if (alternate) {
                    if (ready(player, "hammer_launch", 15)) {
                        hammerLaunch(player);
                    }
                } else if (ready(player, "hammer_crack", 15)) {
                    hammerCrack(player);
                }
            }
            default -> { }
        }
    }

    @EventHandler
    public void onFrozenMove(PlayerMoveEvent event) {
        if (!frozenUntil.containsKey(event.getPlayer().getUniqueId()) || event.getTo() == null) {
            return;
        }
        if (event.getFrom().getX() != event.getTo().getX() || event.getFrom().getY() != event.getTo().getY()
                || event.getFrom().getZ() != event.getTo().getZ()) {
            event.setTo(event.getFrom().setDirection(event.getTo().getDirection()));
        }
    }

    @EventHandler
    public void onHammerFall(EntityDamageEvent event) {
        if (!(event.getEntity() instanceof Player player) || event.getCause() != EntityDamageEvent.DamageCause.FALL) {
            return;
        }
        Long launchTime = hammerLaunches.remove(player.getUniqueId());
        if (launchTime == null || System.currentTimeMillis() - launchTime > 12_000L) {
            return;
        }
        event.setCancelled(true);
        hammerSlam(player);
    }