π
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.
Create the Maven/Paper project metadata and default configuration.
Implement shared utilities plus configuration, cooldown, weapon, ability, and command managers.
Add the eight separate weapon implementations and event wiring.
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
PlayerSwapHandItemsEventCooldown management
Weapon-specific normal attacks
/reaperweaponand/rwcommandsGive, list, reload, and tab completion support
Permissions and configurable messages
Particle, sound, knockback, teleport, healing, bleed, wither, slowness, and lightning effects
Project structure:
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:
mvn clean package
The compiled plugin will be generated at:
target/ReaperWeapon.jar
Copy that JAR into the serverβs:
plugins/
directory and restart the Paper server.
make it in .jar
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:
mvn clean package
The compiled file will be:
target/ReaperWeapon-1.0.0.jar
Then copy it to:
your-server/plugins/
If Maven is not installed, install Maven and Java 21 first, then run:
java -version
mvn -version
mvn clean package
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();
}
}
}