HandleGaming
πŸ“Ž 1 file 6,158 chars
πŸ“„
pasted-code-1787518280093.txt
txt 310 lines
β–Ά
Create a complete **Minecraft Paper plugin** named **ReaperWeapon** for **Paper 1.21.11** using **Java 21** and Maven.

## Plugin Information

* Plugin Name: `ReaperWeapon`
* Main Package: `me.reaperweapon`
* Main Class: `ReaperWeapon`
* Minecraft Version: `1.21.11`
* Server Software: Paper
* Java Version: 21

The plugin must compile successfully into a `.jar` file and be ready to place inside the Minecraft server `plugins` folder.

# Custom Weapons

Create powerful custom weapons with unique names, lore, abilities, particles, sounds, cooldowns, and damage.

## 1. HandleLust

Special legendary weapon.

### Normal Attack

* Deals exactly **5 hearts of damage**
* 5 hearts = 10 health points
* Add red/dark particles when attacking
* Add powerful slash sound

### Ability 1 β€” SHIFT + F

* Detect using `PlayerSwapHandItemsEvent`
* Only activate when the player is sneaking
* Cancel the normal item swap
* Perform a powerful dash forward
* Damage nearby enemies
* Add red particles
* Add cooldown

### Ability 2 β€” F

* Detect using `PlayerSwapHandItemsEvent`
* Only activate when the player is NOT sneaking
* Cancel the normal item swap
* Perform a powerful slash attack
* Damage players/entities in front of the player
* Add particles and sounds
* Add cooldown

---

## 2. ShadowFall

Dark shadow weapon.

### Normal Attack

* High damage
* Dark particles
* Chance to apply Wither effect

### Ability 1 β€” SHIFT + F

**Shadow Teleport**

* Teleport the player forward safely
* Damage nearby enemies after teleport
* Spawn dark particles
* Add cooldown

### Ability 2 β€” F

**Shadow Explosion**

* Create a damage area around the player
* Do not destroy blocks
* Damage nearby enemy players/entities
* Add smoke and dark particles
* Add cooldown

---

## 3. SlyrexGauntlet

A powerful magical gauntlet.

### Normal Attack

* Strong melee damage
* Knockback effect

### Ability 1 β€” SHIFT + F

**Ground Smash**

* Launch nearby enemies upward or backward
* Create particle shockwave
* Damage enemies in a radius
* Add cooldown

### Ability 2 β€” F

**Power Punch**

* Launch the player slightly forward
* Damage the targeted enemy heavily
* Add knockback
* Add particles and sounds
* Add cooldown

---

# Additional Weapons

Also create these weapons:

## 4. ReaperScythe

* Normal powerful attack
* SHIFT + F: Soul Spin
* F: Soul Drain
* Soul Drain restores some health to the attacker

## 5. VoidBlade

* Dark purple themed weapon
* SHIFT + F: Void Dash
* F: Void Slash
* Add End particles

## 6. BloodKatana

* Red themed weapon
* SHIFT + F: Blood Rage
* F: Bleeding Slash
* Apply damage-over-time effects

## 7. ThunderHammer

* Lightning themed weapon
* SHIFT + F: Thunder Strike
* F: Shockwave
* Lightning should not cause unwanted fire damage

## 8. FrostBlade

* Ice themed weapon
* SHIFT + F: Frost Dash
* F: Freeze Blast
* Apply Slowness to enemies

# Ability Controls

The plugin must use:

```text
SHIFT + F = Ability 1
F = Ability 2
```

Use:

```java
PlayerSwapHandItemsEvent
```

Logic:

```text
Player holds a ReaperWeapon
        ↓
Player presses F
        ↓
Check if player is sneaking
        ↓
YES β†’ Ability 1
NO  β†’ Ability 2
        ↓
Cancel normal hand swap
        ↓
Activate ability
        ↓
Check cooldown
```

The normal hand swap must only be cancelled when the player is holding one of the custom ReaperWeapon items.

# Commands

Create these commands:

```text
/reaperweapon
/rw
/reaperweapon give  
/reaperweapon list
/reaperweapon reload
```

Example:

```text
/reaperweapon give HandleGaming HandleLust
/reaperweapon give HandleGaming ShadowFall
```

Add tab completion for weapon names.

# Permissions

```text
reaperweapon.admin
reaperweapon.give
reaperweapon.reload
```

# Configuration

Create `config.yml` where I can change:

```yaml
weapons:
  HandleLust:
    damage: 10.0
    ability1-cooldown: 10
    ability2-cooldown: 15

  ShadowFall:
    damage: 8.0
    ability1-cooldown: 12
    ability2-cooldown: 20
```

All weapon damage and cooldowns should be configurable.

# Weapon Identification

Use `PersistentDataContainer` and `NamespacedKey` to identify custom weapons.

Do NOT identify weapons only by display name because players could rename normal items.

Each weapon should have:

* Custom display name
* Custom lore
* Enchantment glow
* PersistentDataContainer ID
* Unbreakable item
* Custom model data support for resource packs

# Messages

Create configurable messages:

```yaml
messages:
  prefix: "&8[&cReaperWeapon&8] "
  no-permission: "&cYou don't have permission!"
  cooldown: "&cAbility is on cooldown! &7{time}s"
  received-weapon: "&aYou received &f{weapon}&a!"
  player-not-found: "&cPlayer not found!"
  reloaded: "&aConfiguration reloaded!"
```

# Important Requirements

* Clean and organized Java code
* Separate classes for each weapon
* Separate AbilityManager
* Separate WeaponManager
* CooldownManager
* CommandManager
* EventListener
* ConfigManager
* Use Paper API
* Compatible with Paper 1.21.11
* Java 21
* Maven project
* Include complete `pom.xml`
* Include complete `plugin.yml`
* Include complete `config.yml`
* Include all Java source files
* Show the complete project folder structure
* No placeholder code
* No incomplete methods
* The project must compile successfully

## Project Structure

```text
ReaperWeapon/
β”œβ”€β”€ pom.xml
└── src/
    └── main/
        β”œβ”€β”€ java/
        β”‚   └── me/
        β”‚       └── reaperweapon/
        β”‚           β”œβ”€β”€ ReaperWeapon.java
        β”‚           β”œβ”€β”€ commands/
        β”‚           β”œβ”€β”€ listeners/
        β”‚           β”œβ”€β”€ managers/
        β”‚           β”œβ”€β”€ weapons/
        β”‚           └── utils/
        β”‚
        └── resources/
            β”œβ”€β”€ plugin.yml
            └── config.yml
```

Generate the complete production-ready plugin source code, file by file, and explain exactly how to build the `.jar` using Maven.
Kodari AI
KodariAug 23 at 8:57 am 2
ReaperWeapon
ReaperWeapon is a Paper 1.21.11 plugin adding 8 legendary custom weapons with unique abilities. Each weapon has normal attacks, two special abilities (SHIFT+F and F), configurable damage/cooldowns, particle effects, sounds, and lore. Uses PersistentDataContainer for identification, includes commands, permissions, and a configurable YAML system. Built with Java 21 and Maven, featuring a modular architecture with separate managers for abilities, cooldowns, weapons, and configuration.
  1. Create the Maven/Paper project metadata and default configuration.

  2. Implement shared utilities plus configuration, cooldown, weapon, ability, and command managers.

  3. Add the eight separate weapon implementations and event wiring.

  4. Register commands, permissions, and listeners in the plugin entry point.

Created the complete ReaperWeapon Paper plugin project with:

  • Maven configuration for Java 21 and Paper API

  • Eight custom weapons:

    • HandleLust

    • ShadowFall

    • SlyrexGauntlet

    • ReaperScythe

    • VoidBlade

    • BloodKatana

    • ThunderHammer

    • FrostBlade

  • Configurable damage, cooldowns, lore, names, effects, and custom model data

  • PersistentDataContainer weapon identification

  • F and Shift+F abilities through PlayerSwapHandItemsEvent

  • Cooldown management

  • Weapon-specific normal attacks

  • /reaperweapon and /rw commands

  • Give, list, reload, and tab completion support

  • Permissions and configurable messages

  • Particle, sound, knockback, teleport, healing, bleed, wither, slowness, and lightning effects

Project structure:

Plain Text
ReaperWeapon/
β”œβ”€β”€ pom.xml
└── src/
    └── main/
        β”œβ”€β”€ java/
        β”‚   └── me/
        β”‚       └── reaperweapon/
        β”‚           β”œβ”€β”€ ReaperWeapon.java
        β”‚           β”œβ”€β”€ commands/
        β”‚           β”‚   └── CommandManager.java
        β”‚           β”œβ”€β”€ listeners/
        β”‚           β”‚   └── WeaponListener.java
        β”‚           β”œβ”€β”€ managers/
        β”‚           β”‚   β”œβ”€β”€ AbilityManager.java
        β”‚           β”‚   β”œβ”€β”€ ConfigManager.java
        β”‚           β”‚   β”œβ”€β”€ CooldownManager.java
        β”‚           β”‚   └── WeaponManager.java
        β”‚           β”œβ”€β”€ utils/
        β”‚           β”‚   β”œβ”€β”€ Effects.java
        β”‚           β”‚   └── MessageUtil.java
        β”‚           └── weapons/
        β”‚               β”œβ”€β”€ BloodKatana.java
        β”‚               β”œβ”€β”€ CustomWeapon.java
        β”‚               β”œβ”€β”€ FrostBlade.java
        β”‚               β”œβ”€β”€ HandleLust.java
        β”‚               β”œβ”€β”€ ReaperScythe.java
        β”‚               β”œβ”€β”€ ShadowFall.java
        β”‚               β”œβ”€β”€ SlyrexGauntlet.java
        β”‚               β”œβ”€β”€ ThunderHammer.java
        β”‚               └── VoidBlade.java
        └── resources/
            β”œβ”€β”€ config.yml
            └── plugin.yml

Build the plugin from the project root with:

Shell
mvn clean package

The compiled plugin will be generated at:

Plain Text
target/ReaperWeapon.jar

Copy that JAR into the server’s:

Plain Text
plugins/

directory and restart the Paper server.

HandleGaming

make it in .jar

Kodari AI
KodariAug 23 at 10:13 am 1

I can’t directly attach a compiled .jar from this environment because Maven/build execution isn’t available here. The project source and pom.xml are present.

Build it locally from the ReaperWeapon project folder:

Shell
mvn clean package

The compiled file will be:

Plain Text
target/ReaperWeapon-1.0.0.jar

Then copy it to:

Plain Text
your-server/plugins/

If Maven is not installed, install Maven and Java 21 first, then run:

Shell
java -version
mvn -version
mvn clean package
Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
21 1,147
src/main/java/me/reaperweapon/ReaperWeapon.java
package me.reaperweapon;

import me.reaperweapon.commands.CommandManager;
import me.reaperweapon.listeners.WeaponListener;
import me.reaperweapon.managers.AbilityManager;
import me.reaperweapon.managers.ConfigManager;
import me.reaperweapon.managers.CooldownManager;
import me.reaperweapon.managers.WeaponManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class ReaperWeapon extends JavaPlugin {
    private ConfigManager configManager;
    private CooldownManager cooldownManager;
    private WeaponManager weaponManager;
    private AbilityManager abilityManager;

    @Override
    public void onEnable() {
        configManager = new ConfigManager(this);
        cooldownManager = new CooldownManager();
        weaponManager = new WeaponManager(this, configManager);
        abilityManager = new AbilityManager(configManager, cooldownManager);

        WeaponListener listener = new WeaponListener(weaponManager, abilityManager);
        Bukkit.getPluginManager().registerEvents(listener, this);

        CommandManager commandManager = new CommandManager(this, configManager, weaponManager);
        if (getCommand("reaperweapon") != null) {
            getCommand("reaperweapon").setExecutor(commandManager);
            getCommand("reaperweapon").setTabCompleter(commandManager);
        }
        if (getCommand("rw") != null) {
            getCommand("rw").setExecutor(commandManager);
            getCommand("rw").setTabCompleter(commandManager);
        }
    }

    @Override
    public void onDisable() {
        if (cooldownManager != null) {
            cooldownManager.clear();
        }
    }
}