n6839710-code

make it paper 1.21.11

📎 1 file 2,147 chars
📄
pasted-code-1786038364323.txt
txt 34 lines
▶
Create a Minecraft Paper plugin that adds a full custom equipment set with unique abilities. Each item should have its own powerful ability.

## Equipment & Abilities

* ⚔️ **Sword** – Deals extra damage and has a chance to apply Weakness for 3 seconds.
* 🔨 **Mace** – Creates a small shockwave on critical hits that knocks nearby enemies back.
* ⛏️ **Pickaxe** – Grants Haste II while held and mines blocks faster.
* 🪓 **Axe** – Has a chance to apply Slowness II and deals extra damage to shield users.
* 🛡️ **Shield** – Right-click grants Resistance IV for 3 seconds with a 30-second cooldown.
* ⛑️ **Helmet** – Right-click fires a Warden-style Sonic Boom with a 20-second cooldown.
* 🛡️ **Chestplate** – Grants permanent Strength III while worn.
* 👖 **Leggings** – Grants permanent Resistance II while worn.
* 👢 **Boots** – Grants permanent Speed III while worn.
* 🪽 **Elytra** –

  * The player can fly extremely fast **without needing to actually glide with the Elytra**.
  * While wearing the Elytra, the player has a configurable flight speed multiplier.
  * **Shift + Right Click** increases the speed multiplier by **1**.
  * **Shift + Left Click** decreases the speed multiplier by **1**.
  * The multiplier cannot go below **1x** or above **10x**.
  * Display the current multiplier in the action bar whenever it changes (e.g., `Flight Multiplier: 5x`).
  * The selected multiplier is saved for each player and persists after leaving the server.
  * The flight feels smooth and controllable without excessive lag or rubber-banding.

## Plugin Requirements

* Effects only work while the correct item is equipped (or held where appropriate).
* All active abilities have cooldowns with action bar messages.
* Cooldowns persist even if the player switches items.
* No ability stacking or exploits.
* Custom names, lore, textures (if using a resource pack), and enchantment glint.
* All cooldowns, effect levels, durations, and the Elytra multiplier limits must be configurable in `config.yml`.
* Clean, well-organized code using the latest Paper API with separate classes for each item and ability.
Kodari AI
KodariAug 6 at 5:51 pm 2
LegendaryEquipmentSet
A Paper plugin adding a full custom equipment set with unique abilities. Includes a sword applying Weakness, mace with shockwave knockback, pickaxe granting Haste II, axe with Slowness II and shield damage, shield granting Resistance IV, helmet firing Sonic Boom, chestplate/leggings/boots granting passive Strength III/Resistance II/Speed III, and Elytra with adjustable flight speed multiplier (1x-10x) controlled via shift-click, persisted per player. All cooldowns, effects, and multipliers configurable in config.yml with action bar messages.
  1. Create the Paper 1.21.11 Gradle project and plugin metadata.

  2. Add configurable custom equipment item creation, persistent player data, and cooldown handling.

  3. Implement separate abilities for each weapon, armor piece, shield, helmet, and Elytra.

  4. Register listeners, passive-effect ticking, and an admin command for obtaining the set.

Created the Paper 1.21.11 custom equipment plugin with:

  • Gradle setup targeting Java 21 and Paper 1.21.11

  • Configurable equipment names, lore, materials, glint, model data, cooldowns, effects, and Elytra limits

  • Unique abilities for sword, mace, pickaxe, axe, shield, helmet, armor, and Elytra

  • Persistent per-player Elytra flight multipliers

  • Cooldown tracking with action-bar feedback

  • /customgear give <player> <item|all> admin command

  • Separate ability, item, data, configuration, listener, and command classes

  • Automatic passive effect and flight management while equipment is worn or held

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
21 1,002
src/main/java/com/kodari/customequipment/CustomEquipmentPlugin.java
package com.kodari.customequipment;

import com.kodari.customequipment.ability.CooldownManager;
import com.kodari.customequipment.ability.EquipmentTicker;
import com.kodari.customequipment.command.EquipmentCommand;
import com.kodari.customequipment.config.EquipmentConfig;
import com.kodari.customequipment.data.PlayerDataManager;
import com.kodari.customequipment.item.EquipmentItemFactory;
import com.kodari.customequipment.listener.EquipmentListener;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class CustomEquipmentPlugin extends JavaPlugin {
    private EquipmentConfig equipmentConfig;
    private EquipmentItemFactory itemFactory;
    private PlayerDataManager playerDataManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.equipmentConfig = new EquipmentConfig(this);
        this.itemFactory = new EquipmentItemFactory(this, equipmentConfig);
        this.playerDataManager = new PlayerDataManager(this, equipmentConfig);

        CooldownManager cooldownManager = new CooldownManager();
        EquipmentTicker ticker = new EquipmentTicker(this, equipmentConfig, itemFactory, playerDataManager);
        EquipmentListener listener = new EquipmentListener(this, equipmentConfig, itemFactory, cooldownManager,
                playerDataManager, ticker);

        Bukkit.getPluginManager().registerEvents(listener, this);
        Bukkit.getPluginManager().registerEvents(ticker, this);
        ticker.runTaskTimer(this, 0L, 10L);

        EquipmentCommand command = new EquipmentCommand(itemFactory);
        if (getCommand("customgear") != null) {
            getCommand("customgear").setExecutor(command);
            getCommand("customgear").setTabCompleter(command);
        }
    }

    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveAll();
        }
    }
}