This directory contains complete PocketMine-MP plugins that demonstrate the EasyLibrary 2.0 module system.
- Copy an example plugin directory into the server's
plugins/directory. - Install and enable EasyLibrary 2.0.
- Start the server.
- Inspect the modules with:
/easymodule list
/easymodule doctor
/easymodule services
/easymodule capabilities
/easymodule graphDemonstrates:
easylibrary-modulesinplugin.yml.- A complete
module.yml. BaseModuleandModuleContext.- Module-scoped logging, configuration, and storage.
- A tracked command, listener, repeating task, and cleanup callback.
- A shared service and public module API.
- A module health check.
Commands:
/examplehello
/examplehello api
/examplehello service
/examplehello configProvides a small in-memory economy implementation.
Demonstrates:
- Shared service registration.
- A typed service contract.
- A public module API.
- The
economycapability. - Cross-plugin service consumption.
Commands:
/exampleeco balance
/exampleeco give <player> <amount>
/exampleeco take <player> <amount>Consumes the economy service and capability from
02-economy-provider-plugin.
Demonstrates:
- Required service dependencies.
- Required capability dependencies.
- Optional module dependencies.
- Cross-plugin provider resolution.
Commands:
/examplefarm
/examplefarm harvest
/examplefarm providerRun this example together with 02-economy-provider-plugin.
Provides controlled success and failure cases for diagnostics.
It includes:
- A healthy module.
- A module with a missing module dependency.
- A module with a missing service dependency.
- A module disabled by its manifest.
Use it to test:
/easymodule doctor
/easymodule why <id>
/easymodule failuresname: EasyModuleBasicExample
main: easylibraryexamples\basic\BasicExamplePlugin
version: 1.0.0
api: 5.0.0
src-namespace-prefix: easylibraryexamples\basic
depend:
- EasyLibrary
easylibrary-modules:
- path: modules
namespace: easylibraryexamples\basic\modulesid: examples:hello
name: Hello Module Example
version: 1.0.0
loader: HelloModule
namespace: easylibraryexamples\basic\modules\hello
load: POSTWORLD
enabled: true
provides:
services:
- examples:hello-service
capabilities:
- examples.hello
requires:
services: []
capabilities: []
dependencies: []
soft-dependencies: []
plugin-dependencies: []- Run
01-basic-plugin. - Run
02-economy-provider-pluginand03-farm-consumer-plugintogether. - Add
04-diagnostics-pluginto test controlled failures.
Useful checks:
/easymodule info examples:hello
/easymodule resources examples:hello
/easymodule health examples:hello
/easymodule reload examples:hello
/easymodule disable-runtime examples:hello
/easymodule enable examples:helloPersistent disable test:
/easymodule disable examples:helloRestart the server, verify that the module remains disabled, and then run:
/easymodule enable examples:helloModule reload recreates the instance and runtime resources. It does not unload already loaded PHP classes.