Help

plugin with a spear that if you hold it for like 2-3 seconds it charges up and lets out a beam that can instantly pop someone's totem of undying

Kodari AI
KodariSep 12 at 7:50 pm 1
TotemBeamSpear
A Minecraft plugin introducing a legendary spear weapon. When held for 2-3 seconds, the spear charges up, emitting visual and audio cues. Upon full charge, releasing the attack button fires a powerful beam projectile that travels in a straight line. The beam instantly bypasses normal damage and directly triggers the target's Totem of Undying, consuming it and saving the victim from death. The beam has a limited range and cooldown to prevent spam. Includes charge-up particles, sound effects, and a clear visual beam trail. Players must hold the spear stationary to charge, adding strategic depth to combat.
  • Create the Gradle/Paper plugin scaffold and configuration.

  • Add a tagged spear item and /beamspear command.

  • Add charge tracking, beam ray tracing, particles, and lethal damage to trigger totems.

Created the BeamSpear plugin with:

  • /beamspear and /beamspear give <player>

  • Custom tagged trident Beam Spear

  • 2.5-second charge mechanic while holding right-click

  • Beam ray tracing up to 32 blocks

  • Beam particles and charge effects

  • High damage designed to trigger and pop Totems of Undying

  • Configurable charge time, range, damage, and particles

  • Paper 1.21.4 Gradle setup with XSeries compatibility

Help

MAKE IT FOR 1.21.11

Kodari AI
KodariSep 12 at 7:51 pm 1
  • Update the Paper API target to 1.21.11.

  • Update the plugin metadata to declare Minecraft API 1.21.11.

  • Keep the existing spear behavior and Java 21 setup unchanged.

Updated the plugin for Minecraft/Paper 1.21.11:

  • build.gradle now uses paper-api:1.21.11-R0.1-SNAPSHOT

  • plugin.yml now declares api-version: '1.21.11'

  • Java 21 and the existing Beam Spear functionality remain unchanged

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 415
src/main/java/com/kodari/beamspear/BeamSpearPlugin.java
package com.kodari.beamspear;

import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class BeamSpearPlugin extends JavaPlugin {

    private ChargeManager chargeManager;

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

        BeamService beamService = new BeamService(
                getConfig().getDouble("range", 32.0),
                getConfig().getDouble("damage", 1000.0),
                getConfig().getString("beam-particle", "END_ROD"),
                getConfig().getString("charge-particle", "ELECTRIC_SPARK")
        );
        chargeManager = new ChargeManager(this, beamService, getConfig().getInt("charge-ticks", 50));

        getServer().getPluginManager().registerEvents(new SpearListener(chargeManager), this);

        PluginCommand command = getCommand("beamspear");
        if (command != null) {
            command.setExecutor(new SpearCommand(this));
        }
    }

    @Override
    public void onDisable() {
        if (chargeManager != null) {
            chargeManager.cancelAll();
        }
    }
}