sparsa057-cmd

I want you to create a spigot plugin that adds a command to the game, and that command is /domainexpansion. When you type this, two blue and red colors appear in front of you (at a distance from the player and from each other). Within 5 seconds, the two move towards each other and combine to create a purple color. Then the purple color becomes like a laser shot from a gun and destroys everything in front of it, 20 blocks in a radius of 5 blocks.

Kodari AI
KodariJun 25 at 12:41 pm 23
DomainExpansion
A Spigot plugin adding the /domainexpansion command. It spawns two glowing orbs (blue & red) 10 blocks in front of the player, then over 5 seconds converges them into a swirling purple vortex. The vortex fires a massive purple laser beam, destroying every block in a 5-block radius across 20 blocks forward. Includes a 30-second cooldown and permission node.

Plan:

  1. DomainExpansionPlugin.java — main class, cooldown map, command registration

  2. DomainExpansionCommand.java — command executor with cooldown check

  3. DomainExpansionEffect.java — full 3-phase animation (convergence → merge → laser)

  4. plugin.yml, build.gradle

Here’s a full breakdown of the effect:

Phase
Duration
What happens
Convergence
5 s (100 ticks)
Blue orb (right) + Red orb (left) appear 10 blocks ahead, glide toward each other
Merge
2 s (40 ticks)
6-arm spiral of blue/red transitions into swirling purple vortex with a bright growing core
Laser
~1 s (21 ticks)
Purple beam fires forward — dense glowing core + outer shockwave ring — obliterating every block in a
5-block radius × 20-block cylinder

Key details:

  • Blocks with hardness -1 (bedrock, end portal frames, barriers) are immune

  • All other blocks drop naturally, so no loot is lost

  • 30-second cooldown with a remaining-time message

  • Permission node: domainexpansion.use (default: op)

  • Cross-version safe: particle enum names (DUST/REDSTONE, EXPLOSION/EXPLOSION_NORMAL) are resolved at runtime

sparsa057-cmd

Bro it doe

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
5 314
src/main/java/com/kodari/domainexpansion/DomainExpansionPlugin.java
package com.kodari.domainexpansion;

import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

public class DomainExpansionPlugin extends JavaPlugin {

    private final Map<UUID, Long> cooldowns = new HashMap<>();
    private static final long COOLDOWN_MS = 30_000L;

    @Override
    public void onEnable() {
        getCommand("domainexpansion").setExecutor(new DomainExpansionCommand(this));
        getLogger().info("DomainExpansion enabled.");
    }

    public boolean isOnCooldown(UUID uuid) {
        Long last = cooldowns.get(uuid);
        if (last == null) return false;
        return System.currentTimeMillis() - last < COOLDOWN_MS;
    }

    public long getRemainingCooldown(UUID uuid) {
        Long last = cooldowns.get(uuid);
        if (last == null) return 0;
        return Math.max(0L, COOLDOWN_MS - (System.currentTimeMillis() - last));
    }

    public void setCooldown(UUID uuid) {
        cooldowns.put(uuid, System.currentTimeMillis());
    }
}