ansariiayesha09-glitch

name: WindCharge version: 1.0 main: com.hamza.windcharge.WindCharge api-version: '1.21'

commands: weapon: description: Give custom weapons usage: /weapon give <weapon>

permissions: windcharge.admin: default: op

package com.hamza.windcharge;

import org.bukkit.plugin.java.JavaPlugin;

public class WindCharge extends JavaPlugin {

private static WindCharge instance;

@Override public void onEnable() { instance = this;

getCommand("weapon").setExecutor(new WeaponCommand());

getServer().getPluginManager().registerEvents(new WeaponListener(), this);

getLogger().info("WindCharge Enabled!"); }

@Override public void onDisable() { getLogger().info("WindCharge Disabled!"); }

public static WindCharge getInstance() { return instance; }

}

package com.hamza.windcharge.weapons;

import org.bukkit.Material; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta;

public class BloodFang {

public static ItemStack create() { ItemStack item = new ItemStack(Material.NETHERITE_SWORD); ItemMeta meta = item.getItemMeta();

meta.setDisplayName("§cBlood Fang");

item.setItemMeta(meta); return item; }

}

package com.hamza.windcharge;

import com.hamza.windcharge.weapons.BloodFang; import org.bukkit.command.*; import org.bukkit.entity.Player;

public class WeaponCommand implements CommandExecutor {

@Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

if (!(sender instanceof Player player)) return true;

if (args.length < 2) return true;

if (args[0].equalsIgnoreCase("give")) {

if (args[1].equalsIgnoreCase("bloodfang")) { player.getInventory().addItem(BloodFang.create()); player.sendMessage("§aYou received Blood Fang!"); } } return true; }

}

package com.hamza.windcharge;

import org.bukkit.event.Listener;

public class WeaponListener implements Listener { }

/weapon give bloodfang

Kodari AI
KodariJun 25 at 6:45 pm 3
WindCharge
A custom weapons plugin that adds unique, lore-rich weapons to the game. Features include the Blood Fang netherite sword with custom display names and metadata. Players with the appropriate permissions can obtain weapons via the /weapon give command. Designed as an extensible foundation — new weapons can be added as standalone classes and registered to the command with minimal effort.

All five files are ready. Here’s a summary of the structure:

File
Purpose
plugin.yml
Registers the
/weapon
command and
windcharge.admin
permission
WindCharge.java
Main plugin class — wires up command + listener
weapons/BloodFang.java
Item factory using XSeries for version-safe material lookup
WeaponCommand.java
Handles
/weapon give <name>
with null-safety on item creation
WeaponListener.java
Empty listener ready for weapon ability events

To add a new weapon, create a new class in the weapons package with a static create() method, then add an equalsIgnoreCase branch in WeaponCommand.

Kodari can make mistakes. Review important code before using.
Files
src
Code
5 108
src/main/java/com/hamza/windcharge/WindCharge.java
package com.hamza.windcharge;

import org.bukkit.plugin.java.JavaPlugin;

public class WindCharge extends JavaPlugin {

    private static WindCharge instance;

    @Override
    public void onEnable() {
        instance = this;

        getCommand("weapon").setExecutor(new WeaponCommand());

        getServer().getPluginManager().registerEvents(new WeaponListener(), this);

        getLogger().info("WindCharge Enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("WindCharge Disabled!");
    }

    public static WindCharge getInstance() {
        return instance;
    }
}