PHPackages                             imperazim/easy-library - 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. imperazim/easy-library

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

imperazim/easy-library
======================

PocketMine-MP development toolkit with embedded ImperaZim libraries and a runtime module system

v2.0.0(2mo ago)992[2 PRs](https://github.com/ImperaZim/EasyLibrary/pulls)MITPHPPHP ^8.2CI passing

Since Jul 26Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/ImperaZim/EasyLibrary)[ Packagist](https://packagist.org/packages/imperazim/easy-library)[ RSS](/packages/imperazim-easy-library/feed)WikiDiscussions stable Synced 2w ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (0)

 [![EasyLibrary](icon.gif)](icon.gif)

 [![Version 2.0.0](https://camo.githubusercontent.com/d30d7eb420ef541fcc2347e387e18f34920e4a5e087534e4e17364470dc6c21f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e302e302d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/d30d7eb420ef541fcc2347e387e18f34920e4a5e087534e4e17364470dc6c21f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d322e302e302d626c75653f7374796c653d666c61742d737175617265) [![PocketMine-MP 5.0.0+](https://camo.githubusercontent.com/a4a20a2df750a58a0e380a1a0b8b3e5570e598d96cf2e2ada90136aa68cec479/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f636b65744d696e652d2d4d502d352e302e302b2d626c75653f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a4a20a2df750a58a0e380a1a0b8b3e5570e598d96cf2e2ada90136aa68cec479/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f636b65744d696e652d2d4d502d352e302e302b2d626c75653f7374796c653d666c61742d737175617265) [![PHP 8.2+](https://camo.githubusercontent.com/0a0268c7a5d91dead79d37bc60ba6bcf5ace0dcb07573d6393fcb97953c625c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3737376262343f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/0a0268c7a5d91dead79d37bc60ba6bcf5ace0dcb07573d6393fcb97953c625c2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e322b2d3737376262343f7374796c653d666c61742d737175617265) [![License](https://camo.githubusercontent.com/a55586cd5c6216a1e56147fc60e1c6d1a95ba00909473762321f97923e8a6693/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f496d706572615a696d2f456173794c6962726172793f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/a55586cd5c6216a1e56147fc60e1c6d1a95ba00909473762321f97923e8a6693/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f496d706572615a696d2f456173794c6962726172793f7374796c653d666c61742d737175617265)

EasyLibrary
===========

[](#easylibrary)

**EasyLibrary 2.0** is a PocketMine-MP development toolkit and library distribution for plugin authors. It bundles the ImperaZim `Lib*` ecosystem under stable public namespaces, provides runtime module support, and includes optional bridges for advanced network-aware plugins.

EasyLibrary is designed to be lightweight by default. Optional systems, such as the **EasyLibrary Agent Bridge**, are opt-in and should only be enabled when a server or plugin needs them.

What EasyLibrary provides
-------------------------

[](#what-easylibrary-provides)

- Bundled library APIs for commands, forms, HUDs, databases, serializers, triggers, windows, packets, custom content, enchantments, placeholders and world tooling.
- Standalone-compatible namespaces: the same public imports are used whether a library is installed standalone or embedded through EasyLibrary.
- A plugin-owned module system with manifests, dependency checks, lifecycle cleanup, services and capabilities.
- Utility components for filesystem, cache, scheduling, configuration, messaging, validation, metrics and text helpers.
- Embedded LibPlaceholder and LibWorld host support with route transfer when standalone plugins are enabled or disabled.
- Optional Agent Bridge support for network-aware plugins that need PubSub, registry, KV, flags, locks, RPC, runtime events or safe compute services.

Requirements
------------

[](#requirements)

- PocketMine-MP API 5.0.0+
- PHP 8.2+
- No required external plugin dependencies
- Optional: `EasyLibraryAgent` Go service when using the Agent Bridge

Installation
------------

[](#installation)

Download the EasyLibrary PHAR and place it in the PocketMine-MP `plugins/` directory.

Plugins that require EasyLibrary should declare:

```
depend:
  - EasyLibrary
```

EasyLibrary loads at `STARTUP`.

Quick plugin example
--------------------

[](#quick-plugin-example)

```
use imperazim\command\Command;
use imperazim\form\builder\FormBuilder;
use imperazim\placeholder\PlaceholderAPI;
use imperazim\world\WorldAPI;
```

When using optional Agent features, depend on the split Agent API namespaces instead of the removed pre-1.0 monolithic `AgentAPI` class:

```
use imperazim\agent\api\AgentRuntimeAPI;
use imperazim\agent\api\AgentFlagsAPI;
use imperazim\agent\constant\AgentNetworkFlags;

if(!AgentRuntimeAPI::isAvailable()){
    return; // fallback locally when the bridge is disabled or offline
}

AgentFlagsAPI::set(AgentNetworkFlags::DOUBLE_XP, true, 3600, 'Weekend booster');
```

Bundled libraries
-----------------

[](#bundled-libraries)

LibraryNamespaceMain purpose[LibPlaceholder](https://github.com/ImperaZim/LibPlaceholder)`imperazim\placeholder`Placeholder parsing and expansion registry[LibWorld](https://github.com/ImperaZim/LibWorld)`imperazim\world`World management, instances, regions, selections and block editing[LibPacket](https://github.com/ImperaZim/LibPacket)`imperazim\packet`Packet handlers, monitors, interceptors, recording and profiling[LibCommand](https://github.com/ImperaZim/LibCommand)`imperazim\command`Commands, arguments, constraints, results, macros and dynamic builders[LibForm](https://github.com/ImperaZim/LibForm)`imperazim\form`Long, modal, custom, paginated, conditional and chained forms[LibHud](https://github.com/ImperaZim/LibHud)`imperazim\hud`Boss bars, scoreboards, nametags, titles, notifications and tab lists[LibDB](https://github.com/ImperaZim/LibDB)`imperazim\db`SQLite/MySQL, query builder, models, migrations, seeds, cache and async queries[LibSerializer](https://github.com/ImperaZim/LibSerializer)`imperazim\serializer`Items, blocks, entities, inventories, positions, skins and schematics[LibTrigger](https://github.com/ImperaZim/LibTrigger)`imperazim\trigger`Scheduled global, per-player and item triggers with modes and priorities[LibWindow](https://github.com/ImperaZim/LibWindow)`imperazim\window`Virtual inventories, layouts, sessions, transactions and window presets[LibEnchantment](https://github.com/ImperaZim/LibEnchantment)`imperazim\enchantment`Custom reactive, ticking and toggleable enchantments[LibCustom](https://github.com/ImperaZim/LibCustom)`imperazim\custom`Custom blocks, items, entities, components and palette registrationUse each standalone repository for complete API documentation and examples.

Standalone and embedded modes
-----------------------------

[](#standalone-and-embedded-modes)

Each bundled library can also be installed as an individual plugin. Standalone plugins and EasyLibrary intentionally expose the same namespaces.

```
Standalone installed:
  the standalone plugin is loaded before EasyLibrary and owns its lifecycle

Standalone absent:
  EasyLibrary exposes the embedded implementation and initializes required
  managers for selected libraries

Standalone enabled or disabled at runtime:
  manager ownership moves between standalone and EasyLibrary without clearing
  registered runtime state or public command routes
```

Plugins that accept either distribution can declare optional dependencies:

```
softdepend:
  - EasyLibrary
  - LibPlaceholder
  - LibWorld
  - LibCommand
```

Module system
-------------

[](#module-system)

EasyLibrary 2.0 supports plugin-owned modules discovered through `module.yml` or `module.yaml` manifests.

Declare module sources in the consuming plugin's `plugin.yml`:

```
depend:
  - EasyLibrary

easylibrary-modules:
  - path: modules
    namespace: vendor\plugin\modules
```

Create a manifest:

```
id: vendor:farm
name: Farm System
version: 1.0.0
loader: FarmModule
namespace: vendor\plugin\modules\farm
enabled: true

dependencies:
  vendor:economy: ">=1.0.0"

provides:
  services:
    - vendor:farm-service
  capabilities:
    - vendor.farm
```

Create the module:

```
use imperazim\module\BaseModule;
use imperazim\module\ModuleManager;

final class FarmModule extends BaseModule{
    protected function onEnable(ModuleManager $manager): void{
        $this->provideService('vendor:farm-service', new FarmService());
    }
}
```

`BaseModule` provides helpers for commands, listeners, events, scheduled tasks, async jobs, services, APIs, configuration, data folders, health checks and cleanup callbacks.

EasyLibrary Agent Bridge
------------------------

[](#easylibrary-agent-bridge)

The **EasyLibrary Agent Bridge** is an optional network bridge between PocketMine-MP plugins and the external [`EasyLibraryAgent`](https://github.com/ImperaZim/EasyLibraryAgent) Go service.

It is disabled by default:

```
agent:
  enabled: false
```

When disabled, EasyLibrary does not instantiate the Agent manager, does not register `/easyagent`, does not start heartbeat or PubSub polling, and does not register Agent placeholders. This keeps EasyLibrary lightweight for projects that only need the base libraries.

When enabled, plugins use `imperazim\agent\api\*`, `imperazim\agent\constant\*` and `imperazim\agent\event\*`:

```
use imperazim\agent\api\AgentRuntimeAPI;
use imperazim\agent\api\AgentPubSubAPI;
use imperazim\agent\api\AgentRpcAPI;
use imperazim\agent\constant\AgentChannels;
use imperazim\agent\constant\AgentRpcMethods;

if(!AgentRuntimeAPI::isAvailable()){
    return;
}

AgentPubSubAPI::toGroup('default', AgentChannels::NETWORK_NOTICE, 'Network restart in 5 minutes');
AgentRpcAPI::toServer('lumen-vps', AgentRpcMethods::SERVER_STATUS);
```

The `/easyagent` command is diagnostic/admin/debug tooling. Real network data should be transferred by plugin code through the API and listeners, not by gameplay command flows.

### Agent API namespaces

[](#agent-api-namespaces)

```
imperazim\agent\api\AgentRuntimeAPI
imperazim\agent\api\AgentPubSubAPI
imperazim\agent\api\AgentRegistryAPI
imperazim\agent\api\AgentDeliveryAPI
imperazim\agent\api\AgentRpcAPI
imperazim\agent\api\AgentKVAPI
imperazim\agent\api\AgentFlagsAPI
imperazim\agent\api\AgentLocksAPI
imperazim\agent\api\AgentServerStateAPI
imperazim\agent\api\AgentCommandDispatchAPI
imperazim\agent\api\AgentPlaceholderAPI
imperazim\agent\api\AgentComputeAPI
```

### Agent constants and events

[](#agent-constants-and-events)

Use constants instead of raw strings for standard channels, targets, RPC methods, flags, states and compute methods:

```
use imperazim\agent\constant\AgentChannels;
use imperazim\agent\constant\AgentComputeMethods;
use imperazim\agent\constant\AgentNetworkFlags;
use imperazim\agent\constant\AgentRpcMethods;

AgentChannels::NETWORK_NOTICE;
AgentRpcMethods::SERVER_STATUS;
AgentNetworkFlags::DOUBLE_XP;
AgentComputeMethods::REGION_INTERSECTS;
```

Listen to runtime events when plugins need to react to Agent activity:

```
use imperazim\agent\constant\AgentNetworkFlags;
use imperazim\agent\event\AgentNetworkFlagChangedEvent;
use pocketmine\event\Listener;

final class BoosterListener implements Listener{
    public function onFlagChanged(AgentNetworkFlagChangedEvent $event): void{
        if($event->getFlag() !== AgentNetworkFlags::DOUBLE_XP){
            return;
        }

        // Update local plugin state.
    }
}
```

### Agent compute services

[](#agent-compute-services)

`EasyLibraryAgent` can act as a safe external coprocessor for heavy, global, batch or asynchronous work. Compute methods are allowlisted by the Go service and validated through `AgentComputeMethods` in PHP:

```
use imperazim\agent\api\AgentComputeAPI;
use imperazim\agent\constant\AgentComputeMethods;

AgentComputeAPI::runAsync(AgentComputeMethods::REGION_INTERSECTS, [
    'a' => ['min_x' => 0, 'min_y' => 0, 'min_z' => 0, 'max_x' => 10, 'max_y' => 10, 'max_z' => 10],
    'b' => ['min_x' => 5, 'min_y' => 0, 'min_z' => 5, 'max_x' => 15, 'max_y' => 10, 'max_z' => 15],
]);
```

Use compute for expensive/global tasks. Keep small local or same-tick logic inside PMMP/PHP.

Documentation
-------------

[](#documentation)

### General EasyLibrary docs

[](#general-easylibrary-docs)

- [`docs/getting-started.md`](docs/getting-started.md)
- [`docs/modules.md`](docs/modules.md)
- [`docs/api.md`](docs/api.md)
- [`docs/examples.md`](docs/examples.md)
- [`docs/compatibility.md`](docs/compatibility.md)
- [`docs/migration.md`](docs/migration.md)
- [`docs/standalone-vs-embedded.md`](docs/standalone-vs-embedded.md)

### Agent Bridge docs

[](#agent-bridge-docs)

- [`docs/agent-api.md`](docs/agent-api.md)
- [`docs/agent-api-contracts.md`](docs/agent-api-contracts.md)
- [`docs/agent-constants.md`](docs/agent-constants.md)
- [`docs/agent-compute.md`](docs/agent-compute.md)
- [`docs/agent-runtime-events.md`](docs/agent-runtime-events.md)
- [`docs/agent-command-surface.md`](docs/agent-command-surface.md)
- [`docs/agent-opt-in-runtime.md`](docs/agent-opt-in-runtime.md)
- [`docs/agent-security.md`](docs/agent-security.md)
- [`docs/agent-failure-modes.md`](docs/agent-failure-modes.md)
- [`docs/agent-stable-candidate-checklist.md`](docs/agent-stable-candidate-checklist.md)
- [`examples/agent/`](examples/agent/)

Development
-----------

[](#development)

Install dependencies:

```
composer install
```

Validate Composer metadata:

```
composer validate --strict
```

Lint PHP source:

```
find src -name '*.php' -print0 | xargs -0 -n1 php -l
```

Run the quality target when development dependencies are installed:

```
composer run quality
```

Changelog
---------

[](#changelog)

- [EasyLibrary 2.0.0](changelogs/2.0.md)
- [EasyLibrary 1.3.x](changelogs/1.3.md)
- Development Agent Bridge changes are tracked in [`CHANGELOG.md`](CHANGELOG.md).

License
-------

[](#license)

EasyLibrary is licensed under the [MIT License](LICENSE).

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance90

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.6% 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.

###  Release Activity

Cadence

Every ~172 days

Total

5

Last Release

62d ago

Major Versions

1.3.1 → v2.0.02026-06-16

PHP version history (3 changes)1.1.5PHP ^8.3

1.2.0PHP ^8.1

v2.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b9fc308a46bb613e71af2a06deea6798019ee6cdff0c77a20ba399d904310bc?d=identicon)[ImperaZim](/maintainers/ImperaZim)

---

Top Contributors

[![ImperaZim](https://avatars.githubusercontent.com/u/92953608?v=4)](https://github.com/ImperaZim "ImperaZim (749 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (18 commits)")[![imperazim2-sketch](https://avatars.githubusercontent.com/u/238062272?v=4)](https://github.com/imperazim2-sketch "imperazim2-sketch (5 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

bedrock-serverdeveloper-toolseasylibraryminecraft-bedrockminecraft-pluginmodular-architecturepackage-managerphpphp-libraryplugin-developmentpocketminepocketmine-mppocketmine-pluginruntime

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/imperazim-easy-library/health.svg)

```
[![Health](https://phpackages.com/badges/imperazim-easy-library/health.svg)](https://phpackages.com/packages/imperazim-easy-library)
```

PHPackages © 2026

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