.arceus0.
📎 1 file 1,189 chars
📄
pasted-code-1774883396839.txt
txt 52 lines
▶
Create a custom Minecraft weapon called "Sharpshooter Bow".

Behavior:

The bow should only have the enchantments:

  
Unbreaking III
Mending
Track consecutive hits on a target:

  
After 3 successful consecutive hits, the 4th shot should trigger a special ability.
The 4th shot becomes a massive beam attack that:

  
Deals 3 hearts of true damage (ignores armor and protection enchantments)
Bypasses Totems of Undying
Visually appears as a large blue beam/projectile effect

Cooldown System:

After the special 4th shot is used, apply a 25-second cooldown.
While holding the bow:

  
Show an action bar message indicating:

    
When the ability is READY
When it is ON COOLDOWN (with a countdown timer)

Restrictions:

The ability should NOT work in:

  
Spawn dimension/world
PvP dimension/world
It should function normally in all other dimensions.

Additional Requirements:

Reset the hit counter if:

  
The player misses a shot
Too much time passes between hits (optional configurable timeout)
Ensure compatibility with multiplayer survival servers.

Platform: Minecraft Java Edition
Preferred implementation: **Spigot/Paper plugin 
Kodari AI
KodariMar 30 at 3:19 pm 14,077 (v2)

I’ll create a custom bow plugin with consecutive hit tracking and a special beam attack ability.

SharpshooterBow
A custom bow with consecutive hit tracking that unleashes a devastating beam attack after landing 3 consecutive hits. The special ability deals true damage bypassing armor and totems, features a blue beam visual effect, and has a 25-second cooldown. Includes action bar status display and configurable world restrictions.

All files created! The plugin includes:

Core Features:

  • Custom bow with Unbreaking III and Mending enchantments

  • Tracks consecutive hits (default 3) before special ability activates

  • Special beam attack deals 3 hearts of true damage (bypasses armor)

  • Bypasses Totems of Undying completely

  • 25-second cooldown system

  • Action bar displays ability status (ready/cooldown/hit count)

  • World restrictions for spawn/pvp dimensions

  • Hit counter resets on miss or 10-second timeout

Commands:

  • /sharpshooterbow - Get the custom bow (requires permission: sharpshooterbow.give)

Visual Effects:

  • Blue beam particles (END_ROD, ELECTRIC_SPARK, SOUL_FIRE_FLAME)

  • Explosion particles on impact

  • Thunder and explosion sounds

Configuration: All values are customizable in config.yml including hit requirements, damage, cooldown duration, timeout, disabled worlds, and all messages.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 770
src/main/java/com/sharpshooter/SharpshooterPlugin.java
package com.sharpshooter;

import com.sharpshooter.command.GiveBowCommand;
import com.sharpshooter.listener.BowListener;
import com.sharpshooter.listener.ProjectileListener;
import com.sharpshooter.listener.TotemBypassListener;
import com.sharpshooter.task.ActionBarTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class SharpshooterPlugin extends JavaPlugin {
    @Getter private ConfigManager configManager;
    @Getter private HitTracker hitTracker;
    @Getter private CooldownManager cooldownManager;
    @Getter private BeamEffect beamEffect;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        configManager = new ConfigManager(this);
        hitTracker = new HitTracker(this);
        cooldownManager = new CooldownManager(this);
        beamEffect = new BeamEffect(this);

        registerListeners();
        registerCommands();

        new ActionBarTask(this).runTaskTimer(this, 0L, 20L);
    }

    @Override
    public void onDisable() {
        // Cleanup if needed
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new BowListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ProjectileListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TotemBypassListener(this), this);
    }

    private void registerCommands() {
        getCommand("givebow").setExecutor(new GiveBowCommand(this));
    }
}