Class FireworkSpawner

java.lang.Object
valorless.rarespawns.utils.FireworkSpawner

public class FireworkSpawner extends Object
Spawns randomized fireworks for visual effects.

Provides helpers to spawn one or more fireworks with randomized colors, types, and flags (flicker/trail). Fireworks are scheduled on the server thread using BukkitRunnable and the plugin instance stored in Main.plugin.

  • Constructor Details

    • FireworkSpawner

      public FireworkSpawner()
  • Method Details

    • spawnRandomFireworksWithDelay

      public static void spawnRandomFireworksWithDelay(org.bukkit.entity.Entity mob, int count, int delay)
      Spawns multiple random fireworks with a delay between each.

      The fireworks spawn at the triggering entity's current location and are configured with a random effect and power. The task stops after spawning the requested count.

      Parameters:
      mob - the entity whose location is used for spawning
      count - the number of fireworks to spawn
      delay - the delay between each firework in ticks (20 ticks = 1 second)
    • createRandomFireworkEffect

      public static org.bukkit.FireworkEffect createRandomFireworkEffect()
      Creates a random firework effect with random colors, flicker, and trail.
      Returns:
      a randomly generated FireworkEffect