Shubham Alok
📎 1 file 8,472 chars
📄
pasted-code-1792654436136.txt
txt 205 lines
▶
# Project: Advanced Minecraft Custom Weapons Plugin — Glory SMP Inspired

Act as a senior Minecraft plugin developer specializing in Java, Paper/Spigot APIs, custom combat mechanics, RPG systems, and optimized multiplayer server development.

I want you to develop a **complete, working Minecraft custom weapons plugin inspired by the custom weapons, special abilities, and PvP mechanics featured on Glory SMP**. Use original weapon names, textures where feasible, and balanced abilities. Do not copy any proprietary assets.

## 1. Technical Requirements
- Platform: Minecraft Java Edition
- Server software: Paper
- Target Minecraft version: Latest stable version supported by the development environment; clearly state the exact version.
- Programming language: Java
- Build system: Maven
- Plugin name: CustomWeapons
- Main package: `com.aimlessshubh.customweapons`
- Plugin must be compatible with multiplayer SMP servers.
- Use clean, modular, maintainable Java code.
- Use Adventure API for messages and MiniMessage formatting where appropriate.
- Use PersistentDataContainer to identify custom weapons reliably.
- Avoid NMS and version-dependent internals unless absolutely necessary.

## 2. Custom Weapons

Create a configurable collection of unique weapons, including:

1. **Thunder Sword**
   - Deals bonus lightning damage.
   - Has a configurable cooldown.
   - Lightning visuals should not accidentally damage nearby blocks or players.

2. **Shadow Blade**
   - Grants a short burst of speed when activated.
   - Can perform a short-range dash.
   - Uses particles and sound effects.

3. **Flame Katana**
   - Applies a temporary fire effect to enemies.
   - Has a special flame slash ability.

4. **Frostbite Axe**
   - Temporarily slows enemies.
   - Creates a frost-themed visual effect on successful activation.

5. **Void Dagger**
   - Provides a short teleport or blink ability.
   - Must validate the destination to prevent teleporting into blocks or bypassing protected areas.

6. **Lifesteal Sword**
   - Restores a configurable amount of health based on damage dealt.
   - Must have a configurable healing cap and cooldown to prevent abuse.

7. **Earthquake Hammer**
   - Creates an area-of-effect ground slam.
   - Has configurable range, damage, knockback, and cooldown.

8. **Wind Spear**
   - Launches the player forward or knocks enemies back.
   - Must prevent excessive velocity and fall-damage exploits.

9. **Dragon Slayer**
   - Deals bonus damage to configured mob types.
   - Has a special ability with configurable effects.

10. **Admin Legendary Weapon**
   - A customizable weapon whose damage, rarity, lore, abilities, particles, and cooldown can be configured.

All weapons must have unique names, colored item names, custom lore, rarity levels, balanced stats, and clearly displayed abilities.

## 3. Weapon Activation System

Support configurable activation methods:
- Right-click
- Sneak + right-click
- Left-click where supported by the event system
- Optional custom key-like interactions using supported Minecraft mechanics

Prevent conflicting interactions with vanilla items and other plugins. Implement reliable cooldown handling and prevent abilities from activating repeatedly during a single interaction.

## 4. Commands and Permissions

Implement these commands:

- `/cw give   [amount]`
- `/cw list`
- `/cw reload`
- `/cw info `
- `/cw cooldown  `
- `/cw version`
- `/cw help`

Permissions:
- `customweapons.admin`
- `customweapons.give`
- `customweapons.reload`
- `customweapons.use`
- `customweapons.craft`

Include tab completion, helpful error messages, player-name validation, console support wherever applicable, and permission checks.

## 5. Configuration

Generate a complete `config.yml` with settings for:
- Weapon damage and bonus damage
- Cooldowns
- Ability range and duration
- Particle and sound effects
- Weapon rarity and lore
- Recipe crafting
- Allowed and blocked worlds
- PvP and PvE behavior
- WorldGuard integration where supported
- Friendly-fire protection
- Weapon drop and death behavior
- Ability limits and anti-exploit settings
- Debug logging
- Default messages

Administrators must be able to change weapon settings without recompiling the plugin.

The `/cw reload` command must safely reload configuration and handle invalid values without crashing the server.

## 6. Crafting and Item Security

- Give every custom weapon a persistent, unique identifier.
- Never identify a custom weapon using only its display name or lore.
- Add optional configurable crafting recipes.
- Prevent recipe duplication and unintended ingredient exploits.
- Ensure weapons remain identifiable after relogging, inventory movement, server restarts, and item storage.
- Handle weapon stacking safely.
- Provide an option to prevent custom weapons from being placed in containers or dropped, if configured.

## 7. Combat Balance and Anti-Exploit Protection

- Add per-weapon cooldowns.
- Prevent ability spam and duplicate event execution.
- Respect PvP-disabled worlds and protected regions when integrations are enabled.
- Prevent unintended damage to allies, pets, armor stands, and protected entities.
- Validate teleport destinations and movement abilities.
- Prevent excessive healing, damage, knockback, and particle spawning.
- Clean up temporary tasks and player data when players disconnect.
- Avoid memory leaks and expensive repeating tasks.
- Make all combat values configurable.

## 8. Optional Resource Pack Support

Design the plugin so it can optionally support a resource pack for custom weapon textures using CustomModelData or the appropriate item model system for the target Minecraft version.

Provide:
- Example model identifiers
- Example resource pack folder structure
- Example item model JSON files if applicable
- Instructions for assigning textures to weapons
- Clear explanation of what requires a resource pack and what works without one

Do not claim that custom 3D models or textures are generated automatically by the plugin.

## 9. Code Architecture

Use a clean project structure with separate classes for:
- Main plugin class
- Weapon registry and definitions
- Weapon identification and item creation
- Ability execution
- Combat event listeners
- Cooldown manager
- Command handling
- Tab completion
- Configuration management
- Optional integrations
- Utility classes

Use interfaces or reusable abstractions so new weapons can be added without rewriting the whole plugin.

## 10. Required Deliverables

Provide the complete project, including:

1. Full Maven project structure.
2. Complete `pom.xml`.
3. Correct `plugin.yml`.
4. All Java source files, with no missing classes or placeholder implementations.
5. Complete default `config.yml`.
6. Example weapon definitions.
7. Optional resource pack example files.
8. Build instructions for Windows.
9. Installation instructions for a Paper Minecraft server.
10. Testing instructions for single-player testing through a local server and multiplayer testing.
11. Troubleshooting instructions for common compilation and runtime errors.

## 11. Development Rules

- Do not provide pseudocode in place of working implementations.
- Do not omit files referenced by imports or configuration.
- Do not use deprecated APIs when a supported alternative exists.
- Verify event handling, permissions, cooldowns, and API compatibility against the selected Paper version.
- Explain any version-specific limitations.
- Keep the plugin efficient for an SMP server with multiple concurrent players.
- If a feature requires an external dependency, clearly explain how to install it and make the integration optional.
- Include sensible defaults and ensure the plugin can start even if optional integrations are absent.
- Build and validate the project if tools are available, and fix compilation errors before presenting the final result.

Start by stating the target Minecraft/Paper version and presenting the project architecture. Then implement the plugin file by file, followed by build and installation instructions.

The final result must be a usable custom weapons plugin for my Minecraft SMP server, not merely a tutorial or design proposal.

Developer/creator identity: AimlesShubh.
Kodari AI
KodariOct 22 at 7:48 am 2
CustomWeapons
Advanced custom weapons plugin for Paper SMP servers featuring ten unique weapons with configurable abilities, cooldowns, and rarity. Includes command system, permission management, YAML configuration, crafting recipes, persistent item identification, anti-exploit protections, and optional resource pack support. Built with modular architecture for easy weapon expansion.

Target: Paper 1.21.4 with Java 21. Architecture: a config-backed weapon registry, PDC-based item identity, dedicated cooldown/recipe managers, event-driven combat abilities, and a permission-checked /cw command. I’m creating the Gradle project files and defaults now.

[Generation stopped]

Shubham Alok
📎 1 file 9,757 chars
📄
pasted-code-1792658808606.txt
txt 238 lines
▶
## 12. Custom Weapons System — Core Feature

Build a complete custom weapon system inspired by the unique weapons, rarity tiers, special attacks, and combat mechanics of Glory SMP-style Minecraft servers.

These must be functional weapons with real abilities, not just renamed vanilla items. Use vanilla Minecraft items as weapon bases and implement abilities through the verified Paper 26.2 API. No client-side mods should be required.

### A. Custom Swords

Create these example swords:

**1. Inferno Blade**
- Appearance: Netherite sword with a red-orange theme.
- Passive: Fire particles while held.
- Ability: Launch a fiery slash projectile.
- Effect: Damages eligible targets and applies a configurable fire effect.
- Cooldown: 8 seconds.

**2. Frostbite Sword**
- Appearance: Diamond sword with an icy blue theme.
- Passive: Ice particles.
- Ability: Release an ice wave that slows nearby enemies.
- Cooldown: 10 seconds.

**3. Thunder Katana**
- Appearance: Netherite sword with a purple lightning theme.
- Ability: Perform a fast dash slash and trigger a lightning visual effect.
- Damage and movement must be configurable and balanced.
- Cooldown: 12 seconds.

**4. Void Reaper**
- Appearance: Dark purple sword.
- Ability: Release a short-range void wave.
- Secondary ability: Briefly teleport behind a target when a safe destination is available.
- Cooldown: 15 seconds.

**5. Celestial Blade**
- Appearance: Golden legendary sword.
- Ability: Release a radiant area attack.
- Special effect: Golden particles and a unique sound.
- Cooldown: 20 seconds.

### B. Custom Bows and Ranged Weapons

**1. Storm Bow**
- Fires an arrow that triggers a configurable lightning-themed impact effect.
- Use safe projectile tracking and avoid destructive world changes.

**2. Explosive Bow**
- Fires an arrow that creates a controlled explosion effect.
- No terrain damage by default.
- Explosion damage, radius, and cooldown must be configurable.

**3. Frost Bow**
- Fires icy arrows that slow eligible targets.
- Use custom projectile identification to prevent ordinary arrows from inheriting the effect.

**4. Phantom Bow**
- Fires a magical projectile with a short particle trail.
- Can briefly reveal or mark a target after a successful hit.

**5. Phoenix Bow**
- Fires a fiery projectile with a unique visual trail.
- Apply a configurable fire effect on a successful hit.

All bows must support normal ammunition rules, durability, enchantments, and configurable special-shot behavior. Prevent abilities from triggering twice for the same projectile.

### C. Custom Magical Spheres

Implement magical spheres as custom items based on supported vanilla item types. They should have unique names, lore, visual effects, and ability behavior.

**1. Fire Sphere**
- Throws a fire projectile.
- Applies configurable impact damage and fire effects.

**2. Ice Sphere**
- Releases an icy burst on impact.
- Slows nearby eligible enemies.

**3. Gravity Sphere**
- Pulls eligible nearby entities toward a central point.
- Must respect safe radius limits and region restrictions.

**4. Healing Sphere**
- Creates a short-duration healing zone.
- Allow configurable ally targeting and PvP restrictions.

**5. Void Sphere**
- Releases a dark energy burst.
- Applies configurable damage or a temporary debuff.

**6. Lightning Sphere**
- Creates a lightning-themed impact effect.
- Real lightning damage must be optional and configurable.

Spheres must have configurable charges, cooldowns, projectile speed, range, effects, and recipes. Track each launched sphere using persistent projectile metadata or another reliable server-side identification system.

### D. Custom Maces

**1. Titan Mace**
- A heavy melee weapon with a powerful impact attack.
- Bonus damage should depend on configurable conditions, such as falling distance.
- Do not accidentally stack custom damage with vanilla mace damage.

**2. Thunder Mace**
- Creates a lightning-themed shockwave on a successful hit.
- Configurable area damage and cooldown.

**3. Earthshaker Mace**
- Produces a ground-impact particle effect.
- Temporarily slows eligible nearby enemies.

**4. Gravity Mace**
- Pulls nearby enemies toward the impact location.
- Include safe movement checks and configurable range.

**5. Voidbreaker Mace**
- A high-rarity weapon with a powerful single-target ability.
- Include a clear activation effect, cooldown, and configurable damage cap.

Preserve compatible vanilla mace mechanics where possible, and explicitly define how custom damage interacts with armor, enchantments, critical hits, shields, and vanilla smash attacks.

### E. Additional Weapon Types

Implement a modular framework that can support:

- **Daggers:** Fast attacks with short-range dash abilities.
- **Spears:** Longer-reach thrust attacks or throwable spear abilities.
- **Battle axes:** Heavy strikes and defensive-breaking effects, subject to balance settings.
- **Scythes:** Wide sweeping attacks.
- **Magic staffs:** Launch elemental projectiles.
- **Shields:** Custom defensive abilities and temporary protection.
- **Tridents:** Custom return effects, water abilities, or lightning-themed attacks.
- **Crossbows:** Charged special bolts and configurable burst abilities.

Use supported vanilla base items. For weapon types without a distinct vanilla item model, clearly document that the initial version uses a vanilla model unless a resource pack is supplied.

### F. Weapon Rarity and Progression

Create these rarity levels:

1. Common
2. Uncommon
3. Rare
4. Epic
5. Legendary
6. Mythic
7. Divine

Each rarity should support configurable:

- Name color and lore formatting.
- Ability strength and cooldowns.
- Crafting difficulty.
- Drop chance.
- Enchantment limits.
- Weapon durability.
- Ownership or unique-copy limits.

Rarity must not automatically make weapons overpowered. Keep all damage, effects, and cooldowns configurable.

### G. Weapon Controls

Support the following configurable activation methods:

- Right-click to activate an ability.
- Sneak + right-click for a secondary ability.
- Left-click events for supported melee abilities.
- Sneak + left-click where the API and input behavior allow reliable detection.
- Automatic passive abilities when a weapon is held or equipped.

Prevent the same interaction from activating multiple abilities accidentally. Handle bow drawing and release separately from right-click abilities.

### H. Weapon Identity and Anti-Exploit Protection

Every custom weapon must have a unique internal ID.

- Store weapon identity and relevant metadata using PersistentDataContainer or an appropriate supported mechanism.
- Validate identity before activating abilities.
- Prevent renamed vanilla weapons from being treated as custom weapons.
- Prevent unintended duplication through crafting, inventory manipulation, or death handling.
- Ensure dropped, traded, stored, and transferred weapons retain their identity.
- Provide configurable policies for death drops, durability, repair, and item stacking.
- Do not allow an ordinary item to inherit special abilities just because its display name matches.

### I. Custom Weapon Commands

Add these commands to the existing `/li` command system:

- `/li weapons` — List all registered weapons.
- `/li give  ` — Give a custom weapon.
- `/li weaponinfo ` — Display stats, rarity, abilities, and cooldowns.
- `/li stats  ` — Inspect weapon configuration and player cooldown status.
- `/li repair  ` — Repair a weapon, subject to permissions.
- `/li upgrade  ` — Upgrade a weapon if the progression system allows it.
- `/li reload` — Reload weapon configuration safely.

Include permission checks, tab completion, and helpful error messages.

### J. Weapon Configuration

Add a `weapons.yml` file containing all weapon definitions.

Every weapon should support configuration for:

- Internal ID and display name.
- Vanilla base material.
- Rarity and lore.
- Damage modifiers.
- Attack range and area of effect.
- Ability descriptions and activation methods.
- Cooldowns and ability durations.
- Projectile properties.
- Particle and sound effects.
- Recipes and unlock requirements.
- Durability, repair, and enchantment rules.
- PvP and world restrictions.
- Drop behavior and unique-copy limits.

Administrators must be able to add new weapons by editing configuration wherever possible, without creating a new Java class for each individual weapon.

### K. Required Testing

Test all weapon categories on a clean Paper 26.2 server:

1. Verify every weapon can be obtained and identified.
2. Test melee damage, armor interactions, and enchantments.
3. Test bow drawing, shooting, and projectile impacts.
4. Test spheres, collision detection, and effect radius.
5. Test mace attacks, falling damage, and custom shockwaves.
6. Verify cooldowns, charges, and ability cancellation.
7. Test death, item drops, inventory movement, and relogging.
8. Test interaction with protected regions and PvP settings.
9. Verify configuration reloads do not duplicate recipes or scheduled tasks.
10. Compile and run the plugin, reporting actual results.

Deliver the complete updated Maven project and compiled plugin JAR if the environment permits. Do not leave weapon abilities as placeholders or implement them as visual effects only.

**Important:** Prioritize a working, balanced weapon system with a reusable ability engine. Verify all implementation details against the actual Paper 26.2 API before coding.
Kodari AI
KodariOct 22 at 8:57 am 2
  1. Set up the Maven Paper project and /li//cw command entry point.

  2. Add configurable weapon identity, recipes, cooldowns, and event-driven melee, bow, and sphere abilities.

  3. Include default weapon definitions and concise setup/resource-pack guidance.

Created the Maven CustomWeapons project with /li and /cw commands, PDC-based weapon identity, configurable weapons and recipes, cooldowns, progression, and event-driven abilities for the example swords, bows, spheres, and maces. The default definitions and setup guidance are included.

Compatibility note: the project targets Paper 1.21.4 with Java 21, not Paper 26.2. WorldGuard is not a hard integration; damage and teleport actions use Paper events, but protected-region behavior should be tested on your server. The resource-pack example is a model template and does not include a generated texture.

I haven’t run a compile or live-server test. To build in Kodari, click Compile (on mobile: ⋮ → Compile Project), then click Compile in the window. If it succeeds, download the JAR from that build.

Kodari can make mistakes. Review important code before using.
Files
examples
src
pom.xml
README.md
Code
11 1,241
src/main/java/com/aimlessshubh/customweapons/CustomWeaponsPlugin.java
package com.aimlessshubh.customweapons;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class CustomWeaponsPlugin extends JavaPlugin {
    private WeaponRegistry weaponRegistry;
    private RecipeManager recipeManager;
    private AbilityListener abilityListener;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        if (!getDataFolder().exists()) getDataFolder().mkdirs();
        if (!new java.io.File(getDataFolder(), "weapons.yml").exists()) saveResource("weapons.yml", false);
        weaponRegistry = new WeaponRegistry(this);
        weaponRegistry.reload();
        recipeManager = new RecipeManager(this, weaponRegistry);
        recipeManager.reload();
        abilityListener = new AbilityListener(this, weaponRegistry);
        Bukkit.getPluginManager().registerEvents(abilityListener, this);
        Bukkit.getPluginManager().registerEvents(recipeManager, this);
        WeaponCommand command = new WeaponCommand(this, weaponRegistry, recipeManager, abilityListener);
        getCommand("li").setExecutor(command);
        getCommand("li").setTabCompleter(command);
        abilityListener.startPassives();
        getLogger().info("Loaded " + weaponRegistry.getWeapons().size() + " weapon definitions.");
    }

    public void reloadSystem() {
        reloadConfig();
        weaponRegistry.reload();
        recipeManager.reload();
    }

    public WeaponRegistry getWeaponRegistry() { return weaponRegistry; }
    public RecipeManager getRecipeManager() { return recipeManager; }
}