Aniket Das

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

  1. 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.

---

  1. 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.

---

  1. 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".

---

  1. 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:

  1. Record the original block state.
  2. Place the temporary water.
  3. Keep track of the affected blocks.
  4. After the duration expires, restore the original blocks.
  5. Make sure blocks that players changed during the flood are handled safely.
  6. 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.

Kodari AI
KodariSep 12 at 8:13 am 2
ApsWeapons
A comprehensive Paper plugin adding four custom weapons with unique abilities. Crown Breaker grants temporary jump boost with End-themed effects. Shadow Sword summons protective baby zombie guards with Netherite gear. Tide Breaker creates temporary floods with block restoration, while its upgraded Ultime version offers enhanced flood capabilities. Features configurable cooldowns, PersistentDataContainer-based item identification, admin commands with tab completion, and a crafting recipe system. Includes guard tracking, flood restoration, and comprehensive configuration options for server administrators.
  1. Create the Maven project and plugin metadata.

  2. Implement custom item identification, recipes, cooldowns, and admin commands.

  3. Implement Crown, Shadow Guard, Tide, and Ultimate Tide abilities.

  4. Add restoration, cleanup, disconnect/world-unload handling, and configuration.

Created the complete ApsWeapons Maven project with:

  • Four custom weapons using PersistentDataContainer identifiers.

  • Crown Charge with jump boost, End particles, sound, and cooldown.

  • Shadow Sword guards with owner tracking, Netherite equipment, protection behavior, lifetimes, and cleanup.

  • Tide Breaker and Ultime Tide Breaker temporary flood systems with original-block restoration.

  • Configurable cooldowns, flood sizes, durations, guard limits, and permanent-flood options.

  • Exact custom-item crafting recipe: 4 Tide Breakers produce 1 Ultime Tide Breaker.

  • /apsweapon <player> <weapon>, /apsweapon reload, and /apsweapon help.

  • Weapon aliases and tab completion.

  • Plugin disable, reload, disconnect, and world-unload cleanup.

  • Maven output configured as ApsWeapons.jar.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
11 955
src/main/java/com/aniketplaysz/apsweapons/ApsWeapons.java
package com.aniketplaysz.apsweapons;

import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.RecipeChoice;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

public final class ApsWeapons extends JavaPlugin {
    private WeaponManager weaponManager;
    private CooldownManager cooldownManager;
    private GuardManager guardManager;
    private FloodManager floodManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        weaponManager = new WeaponManager(this);
        cooldownManager = new CooldownManager();
        guardManager = new GuardManager(this);
        floodManager = new FloodManager(this);
        registerRecipe();
        getServer().getPluginManager().registerEvents(new WeaponListener(this, weaponManager, cooldownManager, guardManager, floodManager), this);
        ApsWeaponCommand command = new ApsWeaponCommand(this, weaponManager);
        getCommand("apsweapon").setExecutor(command);
        getCommand("apsweapon").setTabCompleter(command);
    }

    @Override
    public void onDisable() {
        if (floodManager != null) {
            floodManager.cleanupAll();
        }
        if (guardManager != null) {
            guardManager.cleanupAll();
        }
        if (cooldownManager != null) {
            cooldownManager.clearAll();
        }
    }

    public void reloadPlugin() {
        floodManager.cleanupAll();
        guardManager.reset();
        cooldownManager.clearAll();
        reloadConfig();
    }

    private void registerRecipe() {
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "ultime_tide_breaker"), weaponManager.createWeapon(WeaponType.ULTIME_TIDE_BREAKER));
        recipe.shape("TT", "TT");
        recipe.setIngredient('T', new RecipeChoice.ExactChoice(weaponManager.createWeapon(WeaponType.TIDE_BREAKER)));
        Bukkit.addRecipe(recipe);
    }
}