nazking07
📎 1 file 1,109 chars
📄
pasted-code-1775072175867.txt
txt 19 lines
▶
Plugin Request (Complete Final Version):

Create a Minecraft plugin where, when a player types the command /armor, they receive a full set of iron armor with custom names and special abilities. All armor pieces must be unbreakable and have Protection Level 10.

Armor Details:
Helmet (PRIDE HELMET):
The helmet should allowing blocks to break with a single click.
Chestplate (PRIDE CHESTPLATE):
The chestplate should give the player +4 hearts (extra health) and a Strength effect for an unlimited duration.
Leggings (PRIDE LEGGINGS):
The leggings should give the player +4 hearts (extra health) and a Speed effect for an unlimited duration.
Boots (PRIDE BOOTS):
The boots should give the player +2 hearts (extra health) and completely remove fall damage.
Additional Requirements:
All armor pieces must be unbreakable (durability should never decrease).
All armor pieces must have Protection X (Level 10) enchantment.
If any armor piece is removed, its ability must be disabled immediately.

The plugin must be made for Paper and should support version 1.21.11. If you can develop this plugin
Kodari AI
KodariApr 1 at 7:39 pm 11,240 (v2)

I’ll create a custom armor plugin with special abilities for each piece.

PrideArmorPlugin
Custom armor set plugin that grants players powerful abilities. Features instant block breaking helmet, strength-boosting chestplate, speed-enhancing leggings, and fall damage immunity boots. All pieces have Protection X and provide bonus health. Abilities activate when worn and deactivate when removed. Includes /armor command to receive the full set.

Plan

  • ArmorManager: Creates armor items with PDC tags, manages ability application/removal

  • ArmorCommand: Handles /armor command to give armor set

  • ArmorListener: Detects armor changes, fall damage, and instant block breaking

  • Use XSeries for all materials, enchantments, potions, and attributes

  • Track armor via PersistentDataContainer for reliable identification

All files created! The plugin implements:

  • Helmet (PRIDE HELMET): Grants Haste X for instant block breaking + instant break on block damage

  • Chestplate (PRIDE CHESTPLATE): +4 hearts (8 health) + permanent Strength effect

  • Leggings (PRIDE LEGGINGS): +4 hearts (8 health) + permanent Speed effect

  • Boots (PRIDE BOOTS): +2 hearts (4 health) + complete fall damage immunity

  • All pieces have Protection X and are unbreakable

  • Abilities activate/deactivate instantly when armor is equipped/removed

  • Uses PersistentDataContainer for reliable armor tracking across restarts

nazking07

The compilation failed with this error:

code
Compilation failed with 1 error(s):

ERROR in src/main/java/com/example/pridearmorplugin/manager/ArmorManager.java at line 166: local variables referenced from a lambda expression must be final or effectively final
                double newMaxHealth = 20.0 + bonusHealth;
                                             ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/example/pridearmorplugin/manager/ArmorManager.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariApr 1 at 7:39 pm 2,494 (v2)

I need to read the ArmorManager.java file to see the context of the compilation error.

I can see the issue. The variable bonusHealth is being modified with += operators, which makes it non-final. When it’s later referenced inside the lambda expression at line 166, Java requires it to be effectively final.

The fix is to create a final copy of bonusHealth before using it in the lambda.

Fixed the lambda finality error by creating a final copy of bonusHealth before using it in the lambda expression.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
6 408
src/main/java/com/example/pridearmorplugin/PrideArmorPlugin.java
package com.example.pridearmorplugin;

import com.example.pridearmorplugin.command.ArmorCommand;
import com.example.pridearmorplugin.listener.ArmorListener;
import com.example.pridearmorplugin.manager.ArmorManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class PrideArmorPlugin extends JavaPlugin {
    private ArmorManager armorManager;

    @Override
    public void onEnable() {
        this.armorManager = new ArmorManager(this);

        ArmorListener armorListener = new ArmorListener(this);
        Bukkit.getPluginManager().registerEvents(armorListener, this);

        ArmorCommand armorCommand = new ArmorCommand(this);
        getCommand("armor").setExecutor(armorCommand);

        getLogger().info("PrideArmorPlugin has been enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("PrideArmorPlugin has been disabled!");
    }
}