g2682.k

Create a Minecraft plugin for version 1.21+.

I want a custom Netherite Sword with a lightning ability.

Item:

Type: Netherite Sword Name: &b&lFella Sword Custom lore supported Ability:

When a player right-clicks with the sword:

A lightning strike hits the target player Target = the player you are looking at (or nearest player within 10 blocks) Effects:

The lightning must damage only the player It must NOT break blocks It must NOT create fire It must NOT damage the environment Only deal damage to the target player Cooldown: 45 seconds per player If used during cooldown, show message: “Ability is on cooldown: X seconds remaining” Commands:

Give item command: /fellaswordlight give All commands should use the base: /fella Customization (config.yml):

Damage amount Range (default: 10 blocks) Cooldown (default: 45 seconds) Item name & lore Messages Features:

Multiplayer support Smooth ability (no lag) No bugs or glitches Optimized performance

Kodari AI
KodariMay 6 at 4:31 pm 6,423 (v2)

I’ll create a lightning sword plugin with customizable abilities and full configuration support.

FellaSwordLight
A custom Netherite sword plugin that grants players lightning strike abilities. Features targeted lightning strikes with raytracing, configurable damage and range, per-player cooldown system, persistent item identification, and full customization for item properties and messages. Optimized for multiplayer with no environmental damage.

Plan

  • Main plugin class with manager initialization

  • CooldownManager for per-player ability timers

  • ConfigManager for all configurable values

  • SwordItemBuilder to create the custom sword with PDC tagging

  • SwordAbilityListener for right-click detection and targeting

  • Command handler for /fella give <player>


Created FellaSwordLight plugin with lightning strike ability. Features include raytracing-based player targeting, visual-only lightning with manual damage (no fire/block damage), persistent data container sword identification, per-player cooldowns, full config customization, and /fella give <player> command with tab completion.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 478
src/main/java/com/fellaswordlight/FellaSwordLight.java
package com.fellaswordlight;

import com.fellaswordlight.command.FellaSwordCommand;
import com.fellaswordlight.listener.SwordAbilityListener;
import com.fellaswordlight.manager.ConfigManager;
import com.fellaswordlight.manager.CooldownManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class FellaSwordLight extends JavaPlugin {
    
    private ConfigManager configManager;
    private CooldownManager cooldownManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.cooldownManager = new CooldownManager();
        
        getServer().getPluginManager().registerEvents(new SwordAbilityListener(this), this);
        getCommand("fella").setExecutor(new FellaSwordCommand(this));
        
        getLogger().info("FellaSwordLight has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("FellaSwordLight has been disabled!");
    }
}