HudsonAI-77

make a plugin so can combine any sword with any armor trim in a crafting table and each trim gives a custom ability. trims can also be put on maces for abilities but when a trim is put on a mace it is a different more powerful ability than if the trim was put on a sword. you can also do the command /ability to see what abilities you have. each trim give 2 abilities, and the first ability is activated by right clicking and the second ability is activated by shift right clicking. each trim also gives the user a positive potion effect based on the trim

Kodari AI
KodariJan 21 at 2:49 am 17,601 (v2)

I’ll create a plugin that allows combining swords/maces with armor trims to grant unique abilities.

TrimAbilities
A custom ability system that combines armor trims with weapons through crafting. Players can craft swords or maces with any armor trim to unlock unique abilities. Each trim provides two distinct abilities activated by right-click and shift right-click, plus passive potion effects. Maces receive more powerful versions of abilities compared to swords. Players can view their active abilities using the /ability command.

Now I’ll create the plugin structure:

Plugin created successfully! Features include:

  • 20 armor trim types with unique abilities for both swords and maces

  • Right-click activates primary ability

  • Shift + right-click activates secondary ability (more powerful)

  • Passive potion effects applied while holding the weapon

  • Mace abilities are significantly stronger than sword abilities

  • /ability command displays current weapon’s abilities

  • Crafting system - combine any sword/mace with any armor trim in crafting table

  • Cooldown system (5 seconds default, configurable)

  • XSeries integration for cross-version compatibility

All trims have distinct themed abilities (Coast = water, Wild = beast rage, Spire = lightning, etc.)

HudsonAI-77

Add a way to craft them, when you have all the materials for the trim sword/mace you do /craft

Kodari AI
KodariJan 25 at 2:09 am 12,586 (v2)

I’ll read the existing files to understand the current structure and crafting system.

Now I’ll create a /craft command that checks if the player has the required materials in their inventory and crafts the trim weapon.

Plan:

  • Create CraftCommand that checks inventory for weapon + trim template

  • Verify player has both materials

  • Remove materials and give crafted weapon

  • Register command in plugin.yml and main class

Done! Added /craft command that:

  • Scans player inventory for weapon (sword/mace) and trim template

  • Validates only one of each material exists

  • Removes both materials and gives crafted trim weapon

  • Shows appropriate error messages for missing/multiple materials

HudsonAI-77

it says i don't have template in my inventory but i do

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
16 1,271
src/main/java/com/trimabilities/TrimAbilities.java
package com.trimabilities;

import com.trimabilities.commands.AbilityCommand;
import com.trimabilities.commands.CraftCommand;
import com.trimabilities.handlers.AbilityHandler;
import com.trimabilities.handlers.CraftingHandler;
import com.trimabilities.handlers.PassiveEffectHandler;
import com.trimabilities.listeners.AbilityListener;
import com.trimabilities.listeners.CraftingListener;
import com.trimabilities.managers.CooldownManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class TrimAbilities extends JavaPlugin {
    
    private AbilityHandler abilityHandler;
    private CooldownManager cooldownManager;
    private CraftingHandler craftingHandler;
    private PassiveEffectHandler passiveEffectHandler;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager(this);
        this.abilityHandler = new AbilityHandler(this);
        this.craftingHandler = new CraftingHandler(this);
        this.passiveEffectHandler = new PassiveEffectHandler(this);
        
        getServer().getPluginManager().registerEvents(new AbilityListener(this), this);
        getServer().getPluginManager().registerEvents(new CraftingListener(this), this);
        
        getCommand("ability").setExecutor(new AbilityCommand(this));
        getCommand("craft").setExecutor(new CraftCommand(this));
        
        passiveEffectHandler.startPassiveEffectTask();
        
        getLogger().info("TrimAbilities enabled successfully!");
    }
    
    @Override
    public void onDisable() {
        if (passiveEffectHandler != null) {
            passiveEffectHandler.stopPassiveEffectTask();
        }
        getLogger().info("TrimAbilities disabled!");
    }
    
    public String getMessage(String path) {
        return getConfig().getString("messages." + path, "").replace("&", "§");
    }
}