PHPackages                             jorgebyte/fireworkslib - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jorgebyte/fireworkslib

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jorgebyte/fireworkslib
======================

Advanced fireworks management library for PocketMine-MP with async support

50PHP

Since Sep 14Pushed 8mo agoCompare

[ Source](https://github.com/Jorgebyte/FireworksLib)[ Packagist](https://packagist.org/packages/jorgebyte/fireworkslib)[ RSS](/packages/jorgebyte-fireworkslib/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

### FireworksLib: Advanced Fireworks Management for PocketMine-MP

[](#fireworkslib-advanced-fireworks-management-for-pocketmine-mp)

A high-performance library for creating and controlling customizable fireworks displays in PocketMine-MP servers.

---

📦 Installation
--------------

[](#-installation)

1. Install via [Composer](https://getcomposer.org):

```
composer require jorgebyte/fireworkslib
```

2. Register in your plugin:

```
use Jorgebyte\FireworksLib\FireworksLib;

public function onEnable(): void {
    FireworksLib::register();
}
```

---

✨ Key Features
--------------

[](#-key-features)

- **Synchronous &amp; Asynchronous Launching**
- **Customizable Explosions** (colors, shapes, effects)
- **Batch Processing** with configurable delays
- **Particle/Sound Synchronization**
- **Mathematical Trajectory Control** (radial distribution, angles)

---

🚀 Usage Examples
----------------

[](#-usage-examples)

### 1. Basic Firework Launch

[](#1-basic-firework-launch)

```
use Jorgebyte\FireworksLib\FireworksManager;
use Jorgebyte\FireworksLib\FireworksRegistry;
use pocketmine\world\Position;

$center = new Position($x, $y, $z, $world);
$firework = FireworksRegistry::FIREWORKS();
FireworksManager::launch($center->asLocation(), $firework);
```

### 2. Customized Firework Item

[](#2-customized-firework-item)

```
use Jorgebyte\FireworksLib\FireworkType;
use pocketmine\color\Color;

$customFirework = FireworksRegistry::FIREWORKS();
$customFirework->setFlightDuration(3); // 3-second fuse
$customFirework->addExplosion(
    type: FireworkType::STAR,
    color: new Color(255, 0, 0), // Red
    fade: new Color(0, 0, 255),  // Blue fade
    flicker: true,
    trail: true
);
```

### 3. Asynchronous Batch Launch (Radial Pattern)

[](#3-asynchronous-batch-launch-radial-pattern)

```
use SOFe\AwaitStd\AwaitStd;

Await::f2c(function () use ($center, $std) {
    yield from FireworksManager::launchMultipleAsync(
        std: $std,
        center: $center,
        firework: FireworksRegistry::FIREWORKS(),
        count: 30,
        radius: 5.0,
        delayBetweenBatches: 0.2
    )->asGenerator();
});
```

---

🧩 API Reference
---------------

[](#-api-reference)

### 🔧 `FireworksManager`

[](#-fireworksmanager)

MethodParametersDescription`launch``Location $location`, `FireworksItem $firework`Sync single firework launch`launchAsync``Location $location`, `FireworksItem $firework`Async generator (Traverser)`launchMultipleAsync``AwaitStd $std`, `Location $center`, `FireworksItem $firework`, `int $count`, `float $radius=3.0`, `float $delayBetweenBatches=0.5`Batch launch in radial pattern### 🧪 `FireworksItem` Methods

[](#-fireworksitem-methods)

```
// Set flight duration (1-3 recommended)
$item->setFlightDuration(int $duration);

// Add explosion effect:
$item->addExplosion(
    int $type,          // FireworkType::CONSTANT
    Color $color,       // Primary RGB
    ?Color $fade = null,// Fade color
    bool $flicker = false,
    bool $trail = false
);
```

### 💥 `FireworkType` Constants

[](#-fireworktype-constants)

ConstantEffect`SMALL_SPHERE`Standard spherical burst`HUGE_SPHERE`Large-scale sphere`STAR`Star-shaped explosion`CREEPER_HEAD`Creeper-face pattern`BURST`Crackle-effect explosion---

🎯 Benefits
----------

[](#-benefits)

1. **Performance Optimization**
    - Batch processing with `BATCH_SIZE` and tick delays
    - Async coroutines prevent server lag
2. **Precision Control**
    - Radial coordinate calculation via `$angleStep = (2 * M_PI) / $count`
    - Customizable delay intervals between batches
3. **Extensibility**
    - Implement custom trajectories by extending `FireworksRocket`
    - Modify `FireworkParticleAnimation` for custom effects

---

🧪 Advanced Implementation
-------------------------

[](#-advanced-implementation)

### Extending FireworksRocket

[](#extending-fireworksrocket)

```
class CustomRocket extends FireworksRocket {
    protected function explode(): void {
        // Custom explosion logic
        parent::explode(); // Call default behavior
    }
}
```

### Direct NBT Manipulation

[](#direct-nbt-manipulation)

```
$nbt = $firework->getNamedTag();
$nbt->getCompoundTag("Fireworks")?->setByte("Flight", 2);
```

---

🤝 Contribution
--------------

[](#-contribution)

1. Fork the repository
2. Adhere to PER-CS2.0 coding standards
3. Submit pull requests with detailed descriptions

**Supported by:**
[Await Generator](https://github.com/SOF3/await-generator)

[Await Std](https://github.com/ACM-PocketMine-MP/await-std)

---

> Transform your server events with mathematically precise firework displays! 🎆
> *Developed by Jorgebyte*

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance43

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/506452539a900076c507cc83aab0f10146ca3fa3b60c7d67a084579a43f72188?d=identicon)[Jorgebyte](/maintainers/Jorgebyte)

---

Top Contributors

[![Jorgebyte](https://avatars.githubusercontent.com/u/134261497?v=4)](https://github.com/Jorgebyte "Jorgebyte (4 commits)")[![poggit-bot](https://avatars.githubusercontent.com/u/22427965?v=4)](https://github.com/poggit-bot "poggit-bot (1 commits)")

### Embed Badge

![Health badge](/badges/jorgebyte-fireworkslib/health.svg)

```
[![Health](https://phpackages.com/badges/jorgebyte-fireworkslib/health.svg)](https://phpackages.com/packages/jorgebyte-fireworkslib)
```

###  Alternatives

[konnco/filament-import

241243.2k2](/packages/konnco-filament-import)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
