ninja_343.
📎 1 file 1,792 chars
📄
pasted-code-1792242109618.txt
txt 22 lines
▶
Role & Task:
You are an expert Minecraft plugin developer. Please create a custom Spigot/Paper plugin that introduces three unique custom items with specialized abilities, passives, and counters.
Item Specifications
1. Freezer Axe
- Base Item: Diamond or Netherite Axe (configurable name and lore).
- Active Ability: On right-click (or hitting an opponent), it freezes the target player using Minecraft's freezing mechanic (or high-level Slowness + particle effects).
  - Cooldown: 1-minute cooldown per player with an action bar / chat alert displaying remaining cooldown time.
- Passive Effects (While Holding in Main/Off-Hand):
  - Grants the Frost Walker effect to turn water underfoot into ice.
  - Fire Aspect Mitigation: Disables and nullifies any Fire Aspect damage or enchantments while held.
2. Flame Sword
- Base Item: Netherite Sword (configurable name and lore).
- Enchantments: Maxed-out combat enchantments, specifically forced to have Knockback I and Fire Aspect II.
- Special Counter Effect: Serves as a direct counter to the Freezer Axe. Holding or equipping the Flame Sword completely disables the Freezer Axe for the holder (or cancels freeze effects caused by the axe).
3. Air Spear
- Base Item: Trident or Custom Spear weapon.
- Enchantment/Passive: Equipped with Lunge V (custom movement boost on attack/dash).
- Charge Ability: Upon charging the weapon (e.g., holding right-click), it grants the player Speed XII (12) for rapid mobility.
Technical Requirements
- Target Version: 1.21.11 (Paper/Spigot API).
- Standard configuration file (config.yml) allowing server admins to tweak item names, cooldown durations, effect levels, and lore text.
- Clean code handling item identification (using NBT tags or persistent data containers to avoid item duplication/spoofing).
Kodari AI
KodariOct 17 at 1:03 pm 1
ElementalWeapons
Adds three unique elemental weapons with specialized abilities and counters. The Freezer Axe freezes targets on hit with a 1-minute cooldown, grants Frost Walker while held, and nullifies Fire Aspect damage. The Flame Sword counters the Freezer Axe by disabling freeze effects for its holder, featuring maxed combat enchantments with forced Knockback I and Fire Aspect II. The Air Spear provides Lunge V on attack and grants Speed XII when charged via right-click. All items use persistent data containers for identification, with configurable names, lore, cooldowns, and effect levels via config.yml.
  1. Set up a Paper 1.21.11 plugin with configurable item definitions and a /customitems give command.

  2. Add persistent item IDs, item creation, and the Freezer Axe, Flame Sword, and Air Spear abilities.

  3. Register combat, movement, fire-mitigation, and counter handling.

Created ElementalArsenal for Paper 1.21.11, with configurable item materials, names, lore, effects, and cooldowns.

  • Freezer Axe: freezes players on hit or right-clicking them, frosts nearby water while held, and mitigates fire damage and ignition.

  • Flame Sword: configured combat enchantments, including Knockback I and Fire Aspect II; counters the Freezer Axe while held.

  • Air Spear: lunges on hit and grants Speed XII on right-click.

  • Custom items are identified with persistent data tags. Give them with /customitems give <player> <freezeraxe|flamesword|airspear> [amount].

  • Settings and messages are in config.yml.

ninja_343.

But it needs to be a spear, not a trident

Flame sword not giving the user fire resistance if he has the sword

And the freezer axe isn't freezing, plus the cooldown needs to be on the action bar

Plus, merge all the things with the texture that I added to the root

Kodari AI
KodariOct 17 at 1:18 pm 1
  1. Replace the Air Spear’s trident base with a spear item.

  2. Grant Fire Resistance while holding the Flame Sword.

  3. Fix Freezer Axe freezing and show its cooldown on the action bar.

  4. Check the root texture asset and integrate it where the project supports it.

  1. Air Spear: changed its configured and fallback material from trident to netherite spear.

  1. Flame Sword: added configurable Fire Resistance while it’s held.

  2. Freezer Axe: I’m fixing the freeze application and routing cooldown notices to the action bar.

  1. Freezer Axe: now applies freeze ticks immediately, force-applies Slowness, and displays remaining cooldown in the action bar.

  2. Texture: checking the root asset to see whether it can be incorporated into this plugin.

  • Changed the Air Spear from a trident to a netherite spear.

  • Added configurable Fire Resistance while the Flame Sword is held.

  • Freezer Axe now applies freeze ticks immediately and force-applies Slowness; cooldown alerts show on the action bar.

  • Linked the three items to the texture pack’s model IDs. The root ZIP appears invalid, so the textures won’t display until a valid resource-pack ZIP is provided and enabled for players.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
super weapon texture.zip
Code
7 580
src/main/java/com/kodari/elementalarsenal/ElementalArsenalPlugin.java
package com.kodari.elementalarsenal;

import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class ElementalArsenalPlugin extends JavaPlugin implements TabExecutor {
    private CustomItemFactory itemFactory;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        itemFactory = new CustomItemFactory(this);
        Bukkit.getPluginManager().registerEvents(new AbilityListener(this, itemFactory), this);
        getCommand("customitems").setExecutor(this);
        getCommand("customitems").setTabCompleter(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length < 3 || !args[0].equalsIgnoreCase("give")) {
            return false;
        }

        Player target = Bukkit.getPlayerExact(args[1]);
        if (target == null) {
            sendConfiguredMessage(sender, "messages.player-not-found");
            return true;
        }

        String itemId = args[2].toLowerCase(Locale.ROOT);
        ItemStack item = itemFactory.create(itemId);
        if (item == null) {
            sendConfiguredMessage(sender, "messages.invalid-item");
            return true;
        }

        int amount = 1;
        if (args.length > 3) {
            try {
                amount = Integer.parseInt(args[3]);
            } catch (NumberFormatException exception) {
                sendConfiguredMessage(sender, "messages.invalid-amount");
                return true;
            }
            if (amount < 1) {
                sendConfiguredMessage(sender, "messages.invalid-amount");
                return true;
            }
        }

        item.setAmount(Math.min(amount, item.getMaxStackSize()));
        target.getInventory().addItem(item).values().forEach(leftover ->
                target.getWorld().dropItemNaturally(target.getLocation(), leftover));
        sendConfiguredMessage(sender, "messages.given", "{item}", itemFactory.getDisplayName(itemId), "{player}", target.getName());
        sendConfiguredMessage(target, "messages.received", "{item}", itemFactory.getDisplayName(itemId));
        return true;
    }

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

    private List<String> partialMatches(String input, List<String> candidates) {
        String prefix = input.toLowerCase(Locale.ROOT);
        return candidates.stream().filter(candidate -> candidate.toLowerCase(Locale.ROOT).startsWith(prefix))
                .collect(Collectors.toList());
    }

    private void sendConfiguredMessage(CommandSender sender, String path, String... replacements) {
        String message = getConfig().getString(path, "");
        for (int index = 0; index + 1 < replacements.length; index += 2) {
            message = message.replace(replacements[index], replacements[index + 1]);
        }
        String prefix = getConfig().getString("messages.prefix", "");
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + message));
    }
}