Skplayz444 Skplayz444

Create a fully functional Minecraft Paper plugin for version 1.21.x using a completely vanilla-looking STONE_SWORD, with no custom textures, visible custom names, or enchantment glint. Add these 4 abilities:

  1. Thunder: While holding right-click, continuously summon lightning at the exact block or target under the player's crosshair. Every lightning strike must deal enough damage to kill the target in one hit, regardless of armor or Protection enchantments. Stop when right-click is released.
  2. Arrow Shot: When the player presses the off-hand swap key (F by default), shoot an arrow. Every arrow must deal at least one-hit lethal damage regardless of armor or Protection enchantments, but must NOT bypass armor completely; armor must still function normally for other damage sources.
  3. Looting 50: Apply Looting level 50 functionality to mob drops without adding any visible enchantment or enchantment glint.
  4. Fire Aspect: Apply Fire Aspect functionality without adding any visible enchantment or enchantment glint.

The sword must look and behave like a normal vanilla Stone Sword, with normal left-click attacks. Implement all abilities through plugin code without visible enchantments. Ensure reliable target detection, proper damage handling, and compatibility with the specified Paper version. Provide complete, build-ready Java source code and plugin.yml.

Kodari AI
KodariOct 27 at 4:11 pm 1
VanillaSwordAbilities
A Paper 1.21.x plugin that adds four hidden abilities to a vanilla-looking Stone Sword without visible enchantments or custom textures. Right-click continuously summons lethal lightning strikes at the crosshair target, dealing one-hit kill damage regardless of armor. Off-hand swap key fires lethal arrows that respect armor mechanics. Hidden Looting 50 and Fire Aspect effects apply to mob drops and attacks without enchantment glint. The sword remains visually identical to a normal Stone Sword with standard left-click combat.
  1. Set up a Paper 1.21.x plugin and a plain, unenchanted Stone Sword obtainable with /thundersword.

  2. Implement ray-traced thunder, lethal-but-armored arrows, Looting 50 drops, and Fire Aspect.

  3. Register the command and listener; vanilla Minecraft does not report right-mouse release for a sword, so thunder will toggle off on a second right-click.

Created the Paper 1.21.4 plugin with a plain Stone Sword, /thundersword command, ray-traced thunder, lethal arrows, Looting 50 loot-table handling, and Fire Aspect. The sword has no visible name or enchantments; its abilities are identified with invisible item data.

Limitation: Vanilla Minecraft does not send the server a right-mouse release signal for a sword, so exact “strike only while held” behavior is not available to a server plugin alone. Thunder starts on right-click and stops on a second right-click or when you switch away from the sword.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 296
src/main/java/com/kodari/stonesword/StoneSwordPlugin.java
package com.kodari.stonesword;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;

public final class StoneSwordPlugin extends JavaPlugin implements CommandExecutor {
    private NamespacedKey swordKey;
    private AbilityListener abilityListener;

    @Override
    public void onEnable() {
        swordKey = new NamespacedKey(this, "ability_sword");
        NamespacedKey lethalArrowKey = new NamespacedKey(this, "lethal_arrow");
        abilityListener = new AbilityListener(this, swordKey, lethalArrowKey);

        Bukkit.getPluginManager().registerEvents(abilityListener, this);
        getCommand("thundersword").setExecutor(this);
    }

    @Override
    public void onDisable() {
        if (abilityListener != null) {
            abilityListener.stopAllThunder();
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can receive the Stone Sword.");
            return true;
        }
        if (args.length > 1 || (args.length == 1 && !args[0].equalsIgnoreCase("give"))) {
            sender.sendMessage("Usage: /thundersword [give]");
            return true;
        }

        var leftovers = player.getInventory().addItem(createSword());
        leftovers.values().forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
        player.sendMessage("You received a Stone Sword with hidden abilities.");
        return true;
    }

    ItemStack createSword() {
        ItemStack sword = XMaterial.matchXMaterial("STONE_SWORD")
            .map(XMaterial::parseItem)
            .orElseThrow(() -> new IllegalStateException("STONE_SWORD is unavailable."));
        ItemMeta meta = sword.getItemMeta();
        meta.getPersistentDataContainer().set(swordKey, PersistentDataType.BYTE, (byte) 1);
        sword.setItemMeta(meta);
        return sword;
    }
}