Launch fireworks with custom effects

Firework

Launch fireworks with fully customizable effects, colors, and shapes.


Firework.launch

entity = await Firework.launch(location, effects=None, power=1)

Spawn a firework rocket at a location.

await Firework.launch(player.location)

FireworkEffect

Builder for individual firework effects. Chain methods to configure, then pass to Firework.launch().

effect = FireworkEffect(shape)

Methods

colors

effect.colors(*colors)

Set the explosion colors.

fade

effect.fade(*colors)

Set the fade-out colors (same formats as colors()).

flicker

effect.flicker(value=True)

Enable the twinkle/flicker effect.

trail

effect.trail(value=True)

Enable particle trails.


Examples

Simple colored firework

effect = FireworkEffect("BALL").colors("RED", "BLUE").trail()
await Firework.launch(player.location, effects=[effect], power=2)

Multiple effects

effects = [
    FireworkEffect("STAR").colors("YELLOW", "ORANGE").flicker(),
    FireworkEffect("BURST").colors("#00FF00").fade("WHITE").trail(),
]
await Firework.launch(location, effects=effects, power=3)

RGB colors

effect = FireworkEffect("BALL_LARGE").colors(
    (255, 0, 128),    # Pink
    (0, 200, 255),    # Cyan
).fade((255, 255, 255)).trail().flicker()

await Firework.launch(player.location.add(0, 5, 0), effects=[effect])

Creeper face

effect = FireworkEffect("CREEPER").colors("GREEN").fade("LIME")
await Firework.launch(player.location, effects=[effect], power=1)