Create a complete, working Minecraft Java Edition Paper plugin for Minecraft 1.21.11.
Plugin Information
Plugin Name: "ApsWeapons"
The plugin adds 4 custom weapons, each with its own special ability.
The plugin must be production-ready, organized, optimized, and compile successfully for Paper 1.21.11.
---
CUSTOM WEAPONS
- Crown Breaker
Weapon Name: "Crown Breaker"
Ability — Crown Charge
When the player uses the Crown Breaker ability:
- Give the player Jump Boost for exactly 1 second.
- Create an End-themed particle effect around the player.
- Play an End-themed sound when activated.
- The ability should feel like a short magical jump/charge.
- Add a cooldown to prevent spam.
- The cooldown should be configurable.
The ability must only work when the player is holding the actual custom Crown Breaker.
---
- Shadow Sword
Weapon Name: "Shadow Sword"
Ability — Owner's Guard
When the player activates the Shadow Sword:
- Spawn one or more Baby Zombies near the player.
- Every Baby Zombie must have:
- Full Netherite Armor - A Netherite weapon - A custom name identifying its owner
Example:
"Aniket's Guard"
If another player named Steve summons it:
"Steve's Guard"
- The guards must follow/protect their owner.
- Guards must never attack their owner.
- Guards should attack enemies that attack their owner.
- Prevent the guards from dropping their Netherite equipment.
- Give the guards a configurable lifetime.
- Add a configurable maximum number of guards per player.
- Add shadow/dark particles when the guards spawn.
- Add an appropriate sound effect.
- Add a cooldown.
The guards should be tracked by the plugin so they can be safely removed when their lifetime expires.
---
- Tide Breaker
Weapon Name: "Tide Breaker"
Ability — Flood
When the player activates the Tide Breaker:
- Create a temporary flood at the player's target location.
- The flood should place water in a configurable area.
- The radius should be configurable.
- The flood height should be configurable.
- The duration should be configurable.
- Add water-themed particles.
- Add water-themed sounds.
- The ability should have a cooldown.
Important
The flood should preferably be temporary.
When the flood duration ends:
- Remove the water created by the ability.
- Do not permanently destroy the player's original blocks.
- Before placing water, remember the original blocks.
- Restore those blocks when the flood ends.
Do not allow the ability to permanently grief the world unless an administrator explicitly enables that option in "config.yml".
---
- Ultime Tide Breaker
Weapon Name: "Ultime Tide Breaker"
This is the upgraded version of the Tide Breaker.
Crafting
Players can create:
4 Tide Breakers → 1 Ultime Tide Breaker
The recipe must specifically require the custom Tide Breaker items, not ordinary Minecraft items.
Use "PersistentDataContainer" or another reliable custom-item identifier to distinguish the weapons.
Ultimate Flood
The Ultime Tide Breaker should have a much stronger Flood ability than the normal Tide Breaker.
Compared to Tide Breaker:
- Larger flood radius
- Greater flood height
- Longer duration
- Stronger water particles
- Stronger sound effects
- More powerful visual effect
All of these values should be configurable.
The Ultimate Flood should also restore the original blocks after the effect ends, unless permanent flooding is enabled in the configuration.
---
OBTAINING THE WEAPONS
There should be a simple admin command:
"/apsweapon <player> <weapon>"
Examples:
"/apsweapon AniketPlaysz crownbreaker"
"/apsweapon AniketPlaysz shadowsword"
"/apsweapon AniketPlaysz tidebreaker"
"/apsweapon AniketPlaysz ultimetidebreaker"
The command should give the requested custom weapon directly to the specified player.
Support easy aliases such as:
- "crown"
- "shadow"
- "tide"
- "ultime"
For example:
"/apsweapon AniketPlaysz crown"
should give the Crown Breaker.
---
ADMIN COMMANDS
Implement:
"/apsweapon <player> <weapon>"
"/apsweapon reload"
"/apsweapon help"
Permissions
Use a permission such as:
"apsweapons.admin"
Only players with the permission should be able to give weapons or reload the plugin.
The command should provide useful error messages for:
- Invalid player
- Invalid weapon
- Missing arguments
- No permission
Add tab completion for player names and weapon names.
---
CUSTOM ITEM IDENTIFICATION
Do NOT identify weapons only by their display name.
Use PersistentDataContainer with unique keys such as:
- "apsweapons:crown_breaker"
- "apsweapons:shadow_sword"
- "apsweapons:tide_breaker"
- "apsweapons:ultime_tide_breaker"
This prevents renamed vanilla items from activating the abilities.
Each weapon should have:
- Custom name
- Custom lore describing its ability
- Appropriate material
- Custom item identifier
- Appropriate enchantment/glint effect if desired
---
ABILITY ACTIVATION
Choose an intuitive activation method, preferably:
Right-click while holding the weapon.
Make sure normal Minecraft interactions are not unnecessarily broken.
If right-click detection conflicts with another action, handle the event safely.
---
CONFIG.YML
Create a detailed "config.yml" containing configurable settings for:
crown-breaker: cooldown: 10 jump-boost-duration: 1 jump-boost-amplifier: 1
shadow-sword: cooldown: 30 guard-count: 2 guard-lifetime: 60
tide-breaker: cooldown: 30 radius: 5 height: 2 duration: 10 permanent-flood: false
ultime-tide-breaker: cooldown: 60 radius: 10 height: 4 duration: 15 permanent-flood: false
You may improve the configuration structure if necessary.
---
EFFECTS
Give every weapon its own visual identity.
Crown Breaker
Use End-themed particles and sounds.
Shadow Sword
Use dark/shadow-themed particles and sounds.
Tide Breaker
Use water-themed particles and sounds.
Ultime Tide Breaker
Use stronger/more impressive water effects.
Do not create excessive particle spam that could cause server lag.
---
SAFETY AND WORLD RESTORATION
For temporary Tide Breaker floods:
- Record the original block state.
- Place the temporary water.
- Keep track of the affected blocks.
- After the duration expires, restore the original blocks.
- Make sure blocks that players changed during the flood are handled safely.
- Avoid creating permanent world damage.
The plugin must also clean up active flood tasks and summoned guards when the plugin is disabled/reloaded.
---
PROJECT STRUCTURE
Create a clean Maven project.
Example:
ApsWeapons/ ├── pom.xml ├── src/ │ └── main/ │ ├── java/ │ │ └── your/package/ │ │ ├── ApsWeapons.java │ │ ├── command/ │ │ │ └── ApsWeaponCommand.java │ │ ├── weapon/ │ │ │ ├── WeaponManager.java │ │ │ ├── CrownBreaker.java │ │ │ ├── ShadowSword.java │ │ │ ├── TideBreaker.java │ │ │ └── UltimeTideBreaker.java │ │ ├── listener/ │ │ │ └── WeaponListener.java │ │ └── guard/ │ │ └── GuardManager.java │ └── resources/ │ ├── plugin.yml │ └── config.yml
You may change the package structure if you have a cleaner architecture.
---
TECHNICAL REQUIREMENTS
- Minecraft: 1.21.11
- Server software: Paper
- Language: Java
- Build system: Maven
- Use the correct Paper API for 1.21.11.
- Avoid NMS unless absolutely necessary.
- Avoid unnecessary dependencies.
- Make the plugin efficient for multiplayer servers.
- Use Bukkit/Paper schedulers correctly.
- Prevent memory leaks.
- Clean up tasks when the plugin disables.
- Handle player disconnects safely.
- Handle world unloads safely.
- Prevent weapon duplication exploits.
- Prevent guard duplication exploits.
- Prevent normal/renamed items from activating custom abilities.
- Make cooldowns reliable.
- Make all important values configurable.
---
FINAL OUTPUT
Provide the complete source code for the entire ApsWeapons plugin project, including:
- "pom.xml"
- "plugin.yml"
- "config.yml"
- All Java classes
- Commands
- Listeners
- Custom item system
- Crafting recipes
- Ability systems
- Guard system
- Flood restoration system
- Cooldown system
The final project must compile successfully into:
"ApsWeapons.jar"
Make the implementation complete rather than providing pseudocode or incomplete examples.