monkey_train

i need you to make a custom wepon for me it is called the stun axe shift + right click to use it has a 40 second cooldown and make sure that 10 seconds after the ability is activated if the user does not hit the enemy it goes on cooldown also make the stun show the cooldown in chat and make it look cool aswell as make it work in every dimension except pvp make the stun 4 seconds where the enemy is stuck in posistion and cannot move and make it an easy command to give it and only for operators

Kodari AI
KodariMar 22 at 8:03 pm 11,664 (v2)

I’ll create a custom Stun Axe weapon plugin with all the features you requested.

StunAxePlugin
A custom weapon plugin featuring the Stun Axe, a powerful ability-based weapon. Players can activate a special stun ability with shift + right-click that immobilizes enemies for 4 seconds when hit. Includes cooldown management, visual effects, dimension restrictions to prevent PVP abuse, and operator commands. Features automatic cooldown trigger if no hit occurs within 10 seconds of activation.

All files created! The Stun Axe plugin is complete with all requested features:

Features:

  • Shift + Right Click to activate (40s cooldown)

  • 10-second hit window or ability expires and goes on cooldown

  • 4-second stun prevents all movement with visual effects

  • Cooldown messages in chat

  • Cool particle effects (electric sparks, crits) and sounds

  • Disabled in PVP worlds (configurable in config.yml)

  • Simple command: /stunaxe <player> (operators only)

How to use:

  1. Operators use /stunaxe <player> to give the weapon

  2. Shift + Right Click to activate the ability

  3. Hit an enemy within 10 seconds to stun them

  4. Enemy is frozen in place for 4 seconds with visual effects

All values are configurable in config.yml including cooldown duration, stun duration, disabled worlds, messages, and effects!

monkey_train

make it so that u can hit the enemy during the 4 seconds and remove the disabled in pvp worlds from the description

monkey_train

make it so that u can hit the enemy during the 4 seconds and remove the disabled in pvp worlds from the description

Kodari AI
KodariMar 22 at 8:08 pm 7,610 (v2)

I’ll read the existing files to understand the current implementation and make the necessary changes.

I’ll make the changes to allow hitting enemies during stun and remove the “disabled in PVP worlds” text from the description.

Changes completed:

  • Removed “disabled in PVP worlds” from the Stun Axe lore in both the utility class and config

  • Players can now hit stunned enemies during the 4-second stun duration (no damage prevention was in place)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 644
src/main/java/com/stunaxe/StunAxePlugin.java
package com.stunaxe;

import com.stunaxe.command.StunAxeCommand;
import com.stunaxe.listener.StunAxeListener;
import com.stunaxe.manager.CooldownManager;
import com.stunaxe.manager.StunManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class StunAxePlugin extends JavaPlugin {
    
    private CooldownManager cooldownManager;
    private StunManager stunManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager(this);
        this.stunManager = new StunManager(this);
        
        getServer().getPluginManager().registerEvents(new StunAxeListener(this), this);
        
        getCommand("stunaxe").setExecutor(new StunAxeCommand(this));
        
        getLogger().info("StunAxePlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (cooldownManager != null) {
            cooldownManager.shutdown();
        }
        if (stunManager != null) {
            stunManager.shutdown();
        }
        getLogger().info("StunAxePlugin has been disabled!");
    }
}