gamer_om_56

. Random Weapon on First Join

When a player joins the server for the first time, they receive one random custom weapon.

The weapon is selected from a list of available weapons.

The player cannot receive another weapon again automatically.

Example message:

You received a custom weapon: Fire Sword (Level 1)

  1. One Custom Weapon per Player

Each player can only have one custom weapon.

The plugin should store player data using UUID.

The weapon type and level should be saved.

Example stored data:

Player UUID Weapon Type Weapon Level

  1. Weapon Upgrade System

Weapons should have three upgrade levels:

Level Description Level 1 Basic weapon Level 2 Increased power Level 3 Maximum power + ability

Example:

Fire Sword Level 1 → normal damage Level 2 → extra damage + fire effect Level 3 → stronger fire ability

Upgrade methods could include:

kills

coins

command

Example command:

/weapon upgrade

  1. Custom Weapon Abilities (Optional but recommended)

Some weapons should have special abilities.

Examples:

Weapon Ability Fire Sword burns enemies Ice Blade slows enemies Thunder Axe lightning strike Wind Spear knockback ability Shadow Dagger speed boost

Abilities can be activated with right click.

  1. Custom Textures with Resource Pack

The plugin should support custom weapon textures.

Textures will be handled using CustomModelData with a resource pack.

Example mapping:

Weapon Item CustomModelData Fire Sword Diamond Sword 1001 Ice Blade Diamond Sword 1002 Thunder Axe Diamond Axe 1003 Shadow Dagger Iron Sword 1004 Wind Spear Trident 1005

The server should send the resource pack automatically when players join.

  1. Weapon Not Lost on Death

If a player dies:

The custom weapon should not drop.

The weapon should remain with the player after respawn.

Other items can drop normally.

Example message:

Your custom weapon has been preserved.

  1. Configuration Files

Admins should be able to edit weapons easily.

Example config files:

config.yml weapons.yml players.yml

Things configurable:

weapon stats

upgrade cost

abilities

model data

  1. Commands

Example commands:

/weapon give <player> /weapon upgrade /weapon menu /weapon reload

  1. Permissions

Example permissions:

customweapons.admin customweapons.give customweapons.reload

  1. Resource Pack Structure

The resource pack should include custom textures.

Example structure:

resourcepack/ │ ├── pack.mcmeta └── assets/ └── minecraft/ ├── models/ │ └── item/ │ └── textures/ └── item/ ├── fire_sword.png ├── ice_blade.png ├── thunder_axe.png ├── shadow_dagger.png └── wind_spear.png

Kodari AI
KodariMar 12 at 5:52 am 21,590 (v2)

I’ll create a complete custom weapons plugin with GUI-based upgrades, abilities, resource pack support, and persistent player data.

CustomWeapons
A comprehensive custom weapons system that gives players unique weapons on first join. Features five legendary weapons with three upgrade levels each, special abilities (fire, ice, lightning, speed, knockback), custom textures via resource pack with CustomModelData, weapon preservation on death, GUI-based upgrade menu, and persistent player data storage. Includes admin commands for weapon management and full configuration support.

Now I’ll create the complete plugin structure:

Complete CustomWeapons plugin created with all features: random weapon distribution on first join, three-level upgrade system, five unique weapons with special abilities, GUI-based menu, weapon preservation on death, resource pack integration, persistent player data storage, and full configuration support.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
22 1,425
src/main/java/com/example/customweapons/CustomWeapons.java
package com.example.customweapons;

import com.example.customweapons.commands.WeaponCommand;
import com.example.customweapons.inventory.gui.GUIListener;
import com.example.customweapons.inventory.gui.GUIManager;
import com.example.customweapons.listeners.DeathListener;
import com.example.customweapons.listeners.InteractListener;
import com.example.customweapons.listeners.JoinListener;
import com.example.customweapons.managers.ConfigManager;
import com.example.customweapons.managers.PlayerDataManager;
import com.example.customweapons.managers.ResourcePackManager;
import com.example.customweapons.managers.UpgradeManager;
import com.example.customweapons.managers.WeaponManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CustomWeapons extends JavaPlugin {
    
    private ConfigManager configManager;
    private WeaponManager weaponManager;
    private PlayerDataManager playerDataManager;
    private UpgradeManager upgradeManager;
    private ResourcePackManager resourcePackManager;
    private GUIManager guiManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.configManager.loadWeaponsConfig();
        
        this.weaponManager = new WeaponManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.upgradeManager = new UpgradeManager(this);
        this.resourcePackManager = new ResourcePackManager(this);
        this.guiManager = new GUIManager();
        
        this.playerDataManager.loadAllPlayerData();
        
        getCommand("weapon").setExecutor(new WeaponCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new JoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new DeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new InteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        
        getLogger().info("CustomWeapons enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAllPlayerData();
        }
        getLogger().info("CustomWeapons disabled!");
    }
}