something_isfishy

Minecraft Plugin Ability System (Item-Based, Key Activation) Command Format

/ability give <ability_name>

Core Mechanic Each command gives the player a custom item The item unlocks a specific ability Ability is activated by:

Sneaking (Shift) + Pressing F (swap offhand key) Activation Rules Player must:

Be sneaking (holding Shift) Press F (swap hand key) Have the correct item in either main hand or offhand Detect using:

PlayerSwapHandItemsEvent Cancel the event to prevent item swapping: event.setCancelled(true) Abilities & Items

  1. Strength

Command: /ability give Strength Item:

Material: ARMS_UP_POTTERY_SHERD Name: &4&lStrength Fish Enchantment: Unbreaking X Ability:

Effect: Strength III Duration: 5 seconds Cooldown: 40 seconds

  1. Speed (Lightning)

Command: /ability give Speed Item:

Material: BLADE_POTTERY_SHERD Name: &b&lSpeed Fish Enchantment: Unbreaking X Ability:

Effect: Strike lightning at targeted entity Damage: 4 hearts Cooldown: 40 seconds

  1. Resistance

Command: /ability give Resistance Item:

Material: BREWER_POTTERY_SHERD Name: &7&lResistance Fish Enchantment: Unbreaking X Ability:

Effects:

Resistance IV Slowness III Duration: 5 seconds Cooldown: 40 seconds

  1. Regeneration

Command: /ability give Regeneration Item:

Material: BURN_POTTERY_SHERD Name: &d&lRegeneration Fish Enchantment: Unbreaking X Ability:

Effect: Regeneration II Duration: 4 seconds Cooldown: 40 seconds

  1. Lucky

Command: /ability give Lucky Item:

Material: DANGER_POTTERY_SHERD Name: &2&lLucky Fish Enchantment: Unbreaking X Ability:

Effect: 50% chance to dodge incoming damage Duration: 10 seconds Cooldown: 40 seconds

Kodari AI
KodariApr 6 at 10:16 am 12,296 (v2)

I’ll create an ability system plugin where players activate special powers by sneaking and pressing F while holding custom pottery shard items.

AbilityFish
A custom ability system that grants players special powers through unique pottery shard items. Activate abilities by sneaking and pressing F (swap hands). Features five distinct abilities: Strength (combat buff), Lightning (targeted strike), Resistance (defensive shield), Regeneration (health restoration), and Lucky (damage dodge). Each ability has balanced cooldowns and visual feedback. Includes admin commands for distribution.

All files created! The plugin features:

Core System:

  • Shift + F (swap hands) activates abilities when holding special items

  • Event is cancelled to prevent actual item swapping

  • Cooldown system (40s per ability)

  • Cross-version compatible using XSeries

Five Abilities:

  1. Strength - Strength III for 5 seconds

  2. Speed (Lightning) - Strikes targeted entity with lightning (4 hearts damage)

  3. Resistance - Resistance IV + Slowness III for 5 seconds

  4. Regeneration - Regeneration II for 4 seconds

  5. Lucky - 50% chance to dodge damage for 10 seconds

Usage:

  • /ability give <ability_name> - Gives the ability item to yourself

  • All items are pottery sherds with Unbreaking X and colored names

  • Players must be sneaking to activate abilities

The system uses event-driven architecture with separate managers for abilities and cooldowns, making it easy to extend with more abilities in the future.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
11 633
src/main/java/com/abilityfish/AbilityFish.java
package com.abilityfish;

import com.abilityfish.command.AbilityCommand;
import com.abilityfish.listener.AbilityActivationListener;
import com.abilityfish.listener.DodgeListener;
import com.abilityfish.manager.AbilityManager;
import com.abilityfish.manager.CooldownManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AbilityFish extends JavaPlugin {
    
    private CooldownManager cooldownManager;
    private AbilityManager abilityManager;
    private DodgeListener dodgeListener;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager();
        this.dodgeListener = new DodgeListener();
        this.abilityManager = new AbilityManager(this);
        
        Bukkit.getPluginManager().registerEvents(new AbilityActivationListener(this), this);
        Bukkit.getPluginManager().registerEvents(dodgeListener, this);
        
        getCommand("ability").setExecutor(new AbilityCommand(this));
        
        getLogger().info("AbilityFish has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("AbilityFish has been disabled!");
    }
    
    public String getMessage(String key) {
        return getConfig().getString("messages." + key, "&cMessage not found: " + key)
                .replace("&", "§");
    }
}