tumny

i want the custom weapon to have a %3 to remove the chestplate on there body and after it does it goes away for 5 secs andd then it comes back and it has a 8% cooldown

Kodari AI
KodariJun 7 at 7:14 am 1

I’ll create a custom weapon plugin with a disarming blade mechanic.

DisarmingBlade
A custom weapon plugin featuring a Disarming Blade with a 3% chance per hit to remove the target's chestplate. The chestplate disappears for 5 seconds before returning to the target. The weapon has an 8-second cooldown between activations. Features configurable weapon name, lore, chance values, duration, and cooldown through config.yml.
tumny

i want the sword to be named Patron Sword and i dont want it before i want it after and it is a netherite sword

Kodari AI
KodariJun 7 at 7:16 am 1

Got it — rename to “Patron Sword” and use a netherite sword

Done:

  • Config: Name changed to &cPatron Sword, lore updated

  • Item: Now a netherite sword instead of diamond

  • Mechanics: 3% chance, 5s removal, 8s cooldown — all already set in config.yml

  • Command: /disarmblade give [player] or /dw give [player]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 254
src/main/java/com/disarmingblade/DisarmingBladePlugin.java
package com.disarmingblade;

import com.disarmingblade.commands.GiveWeaponCommand;
import com.disarmingblade.listeners.CombatListener;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;

public class DisarmingBladePlugin extends JavaPlugin {

    private static DisarmingBladePlugin instance;
    private NamespacedKey weaponKey;

    @Override
    public void onEnable() {
        instance = this;
        weaponKey = new NamespacedKey(this, "custom_weapon");
        saveDefaultConfig();

        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        getCommand("disarmblade").setExecutor(new GiveWeaponCommand(this));
    }

    @Override
    public void onDisable() {
        instance = null;
    }

    public static DisarmingBladePlugin getInstance() {
        return instance;
    }

    public NamespacedKey getWeaponKey() {
        return weaponKey;
    }
}