Walter Rosi

This plugin should just able the creation of 1 mace.

This plugin should add a craftable item (Hell's Sword) that does 10 of damage and has an ability, which can be activated every 20 seconds with the B key, that shoots a fireball that does 3 hearths

Kodari AI
KodariSep 14 at 1:41 pm 1
HellsSword
Adds a craftable Hell's Sword to Minecraft that deals 10 damage per hit. The sword features a special ability activated by pressing the B key, which fires a powerful fireball dealing 3 hearts of damage. The ability has a 20-second cooldown, indicated to the player via chat messages. The sword is obtained through a custom crafting recipe requiring blaze rods, netherite ingots, and obsidian. The plugin handles item metadata, cooldown tracking per player, and event listeners for both combat and ability activation.

Created the HellsSword plugin with:

  • Craftable Netherite-based Hell’s Sword

  • Exactly 10 attack damage

  • Custom name, lore, Fire Aspect II, and persistent item identity

  • Fireball ability dealing 6 damage / 3 hearts

  • 20-second cooldown

  • Fireballs do not create terrain damage or fire

  • Gradle build setup and plugin.yml

Minecraft server plugins cannot directly detect arbitrary keyboard keys such as B. The ability is therefore bound to the swap-hands key, which defaults to F.

Walter Rosi

i tried obtaining this sword but i can't manage to find it

Kodari AI
KodariSep 14 at 1:48 pm 1
  1. Add a /hellssword command so the item can be obtained directly.

  2. Register the command and add a convenient /hellsword alias.

  3. Keep the existing crafting recipe unchanged.

You can now obtain it with:

Plain Text
/hellssword

Alias:

Plain Text
/hellsword

The command gives the player Hell’s Sword directly. The crafting recipe remains available as well. Restart the server or reload the plugin after installing the updated JAR.

Walter Rosi

can you give me the link for the updated plugin?

Kodari AI
KodariSep 14 at 1:49 pm 1

I can’t host or generate a public download link for the plugin from here. You can build the updated JAR locally:

Shell
./gradlew build

The plugin will be generated in:

Plain Text
build/libs/

Copy the resulting .jar file into your server’s plugins folder, then restart the server. Use /hellssword in-game to obtain the sword.

Walter Rosi

can you update the plugin adding a command to get the sword?

Kodari AI
KodariSep 14 at 1:52 pm 1

The command is already included in the current plugin:

Plain Text
/hellssword

Alias:

Plain Text
/hellsword

After rebuilding and replacing the JAR, restart the server and run the command in-game.

Walter Rosi

unfortunately it seems that the sword only does 2 damage so if you could fix that. I would also like to make the damage that the fireball does becomes 5 and the cooldown becomes 10 seconds. Make the sword be unbreakable and with a texture of a full red weapon

Kodari AI
KodariSep 14 at 2:06 pm 1
  1. Fix the sword’s actual attack damage to 10.

  2. Increase fireball damage to 5 and reduce ability cooldown to 10 seconds.

  3. Make Hell’s Sword unbreakable and configure a red weapon texture hook via item model data if supported by the current setup.

Updated the plugin:

  • Hell’s Sword now deals exactly 10 damage

  • Fireball damage increased to 5 damage

  • Ability cooldown reduced to 10 seconds

  • Sword is now unbreakable

  • Added custom model data value 1001 for a full red weapon texture

  • Updated the lore to show the 10-second cooldown

The red texture requires a resource pack whose sword model uses custom model data 1001. Without that resource pack, the sword will remain visually Netherite. Rebuild the plugin, replace the JAR, and restart the server.

Walter Rosi

can you make the recipe like in the centre a netherite sword, on the top right, top left, bottom left and bottom right corner with blaze rods and on the other empty spaces with ghast tiers

Kodari AI
KodariSep 14 at 6:28 pm 1
  1. Update the Hell’s Sword shaped recipe to use a netherite sword in the center, blaze rods in all four corners, and ghast tears in the remaining slots.

  2. Replace the existing recipe registration while preserving the sword item and command behavior.

Updated the crafting recipe:

Plain Text
Blaze Rod   Ghast Tear   Blaze Rod
Ghast Tear  Netherite Sword  Ghast Tear
Blaze Rod   Ghast Tear   Blaze Rod

Rebuild the plugin and replace the JAR in your server’s plugins folder.

Walter Rosi

make the sword unbreakable, unstashable and the only one that can be crafted

Kodari AI
KodariSep 15 at 8:16 pm 1
  1. Make Hell’s Sword unbreakable and explicitly non-stackable.

  2. Ensure its recipe produces only one sword per craft and prevent duplicate crafting when the player already owns one.

The item is already unbreakable and naturally has a maximum stack size of 1. I’ll enforce the “one per player” rule for both crafting and the give command, while keeping the recipe result at exactly one sword.

Updated the plugin to:

  • Keep Hell’s Sword unbreakable.

  • Ensure it remains unstackable.

  • Allow only one Hell’s Sword per player.

  • Prevent crafting another sword if the player already owns one.

  • Prevent /hellssword from giving duplicates.

  • Keep the recipe output to exactly one sword.

Rebuild the plugin and replace the JAR, then restart the server.

Walter Rosi

make the sword unable to be stashed. so it can't go in a chest or anything like things to store items except obviously the inventory or the off hand

Kodari AI
KodariSep 15 at 8:20 pm 1
  1. Block placing Hell’s Sword into any non-player inventory, including chests, hoppers, furnaces, shulkers, anvils, and similar containers.

  2. Cover normal clicks, shift-clicks, hotbar/off-hand swaps, drag actions, and automated hopper/item pickup transfers.

  3. Continue allowing the player inventory and off-hand.

Updated the plugin so Hell’s Sword cannot be stored in:

  • Chests and ender chests

  • Shulker boxes

  • Hoppers and droppers

  • Furnaces, blast furnaces, smokers

  • Anvils, crafting containers, and other storage inventories

  • Any automated item-transfer system

The sword remains usable in the player’s main inventory and off-hand. It also blocks shift-clicking, dragging, hotbar swaps, and hopper transfers into storage.

Rebuild the plugin and replace the JAR, then restart the server.

Walter Rosi

make the sword have a 1.6 attack speed and give the fireball the ability to set on fire players

Kodari AI
KodariSep 15 at 8:57 pm 1
  1. Set Hell’s Sword attack speed to 1.6.

  2. Make the fireball ignite players when it hits them, while preserving its existing damage and cooldown.

Updated:

  • Hell’s Sword now has an attack speed of 1.6.

  • Fireballs now deal 5 damage and set hit players on fire for 5 seconds.

  • The existing 10-second cooldown remains unchanged.

Rebuild the plugin, replace the JAR, and restart the server.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
6 381
src/main/java/com/kodari/hellssword/HellsSwordPlugin.java
package com.kodari.hellssword;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.CraftItemEvent;
import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryMoveItemEvent;
import org.bukkit.event.inventory.InventoryPickupItemEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

public final class HellsSwordPlugin extends JavaPlugin implements CommandExecutor, Listener {

    private HellSwordItem swordItem;
    private HellSwordAbility ability;

    @Override
    public void onEnable() {
        swordItem = new HellSwordItem(this);
        swordItem.registerRecipe();
        getCommand("hellssword").setExecutor(this);

        ability = new HellSwordAbility(swordItem);
        getServer().getPluginManager().registerEvents(ability, this);
        getServer().getPluginManager().registerEvents(this, this);
    }

    @Override
    public void onDisable() {
        if (ability != null) {
            ability.shutdown();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can receive Hell's Sword.");
            return true;
        }

        if (hasHellSword(player)) {
            player.sendMessage(ChatColor.RED + "You already have Hell's Sword.");
            return true;
        }

        player.getInventory().addItem(swordItem.create());
        player.sendMessage(ChatColor.GOLD + "You received Hell's Sword.");
        return true;
    }

    @EventHandler
    public void onCraft(CraftItemEvent event) {
        if (!swordItem.isHellSword(event.getCurrentItem()) || !(event.getWhoClicked() instanceof Player player)) {
            return;
        }

        if (hasHellSword(player)) {
            event.setCancelled(true);
            player.sendMessage(ChatColor.RED + "You already have Hell's Sword.");
        }
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (!(event.getWhoClicked() instanceof Player player)) {
            return;
        }

        Inventory topInventory = event.getView().getTopInventory();
        if (!isStorageInventory(topInventory)) {
            return;
        }

        Inventory clickedInventory = event.getClickedInventory();
        if (clickedInventory == topInventory
                && (swordItem.isHellSword(event.getCursor()) || isSwordFromSwapSource(player, event))) {
            event.setCancelled(true);
            return;
        }

        if (clickedInventory instanceof PlayerInventory
                && event.getAction() == InventoryAction.MOVE_TO_OTHER_INVENTORY
                && swordItem.isHellSword(event.getCurrentItem())) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        if (!swordItem.isHellSword(event.getOldCursor())
                || !isStorageInventory(event.getView().getTopInventory())) {
            return;
        }

        int topInventorySize = event.getView().getTopInventory().getSize();
        if (event.getRawSlots().stream().anyMatch(slot -> slot < topInventorySize)) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInventoryMoveItem(InventoryMoveItemEvent event) {
        if (swordItem.isHellSword(event.getItem()) && !(event.getDestination() instanceof PlayerInventory)) {
            event.setCancelled(true);
        }
    }

    @EventHandler
    public void onInventoryPickupItem(InventoryPickupItemEvent event) {
        if (swordItem.isHellSword(event.getItem().getItemStack())
                && !(event.getInventory() instanceof PlayerInventory)) {
            event.setCancelled(true);
        }
    }

    private boolean isStorageInventory(Inventory inventory) {
        return inventory != null && inventory.getType() != InventoryType.CRAFTING;
    }

    private boolean isSwordFromSwapSource(Player player, InventoryClickEvent event) {
        if (event.getClick() == ClickType.NUMBER_KEY) {
            return swordItem.isHellSword(player.getInventory().getItem(event.getHotbarButton()));
        }
        if (event.getClick() == ClickType.SWAP_OFFHAND) {
            return swordItem.isHellSword(player.getInventory().getItemInOffHand());
        }
        return false;
    }

    private boolean hasHellSword(Player player) {
        return player.getInventory().containsAtLeast(swordItem.create(), 1);
    }
}