PHPackages                             nhanaz/blockdata\_example\_plugin - 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. nhanaz/blockdata\_example\_plugin

AbandonedPocketmine-plugin[Utility &amp; Helpers](/categories/utility)

nhanaz/blockdata\_example\_plugin
=================================

Example plugin to showcase how BlockData read-writes work.

10PHPCI passing

Since Mar 31Pushed 2w ago1 watchersCompare

[ Source](https://github.com/NhanAZ-Plugins/BlockDataExample)[ Packagist](https://packagist.org/packages/nhanaz/blockdata_example_plugin)[ RSS](/packages/nhanaz-blockdata-example-plugin/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (4)Used By (0)

BlockDataExample
================

[](#blockdataexample)

A small PocketMine-MP plugin showing how to use the [BlockData virion](https://github.com/NhanAZ-Libraries/BlockData) to attach persistent information to blocks.

This is a demonstration plugin, not a complete protection system.

What it demonstrates
--------------------

[](#what-it-demonstrates)

- Saving the player name and placement time when a block is placed.
- Allowing only the owner or a player with bypass permission to break that block.
- Toggling inspection mode with `/inspect` and viewing stored block information.
- Building one standalone PHAR with BlockData shaded by DevTools.

Download a PHAR
---------------

[](#download-a-phar)

Open the repository's [Actions page](https://github.com/NhanAZ-Plugins/BlockDataExample/actions/workflows/build.yml), select a successful run, and download its artifact. Extract the ZIP and copy `BlockDataExample.phar` to the production server's `plugins/` directory.

The PHAR already contains a private shaded copy of BlockData. A production server does not need DevTools or a separate BlockData installation.

Build on every commit
---------------------

[](#build-on-every-commit)

The workflow at `.github/workflows/build.yml`:

1. Checks out an exact BlockData commit into `virions/BlockData`.
2. Sets up PocketMine PHP through the Node.js 24 compatible path.
3. Runs `NhanAZ-Plugins/DevTools@v0.1.0`.
4. Verifies the shaded BlockData classes and LGPL license inside the PHAR.
5. Uploads exactly one downloadable artifact for 14 days.

PHPStan is off because the workflow intentionally omits the `phpstan` input.

The dependency declaration is kept in `devtools.yml`:

```
virions:
  - name: BlockData
    version: ^1.0.0
```

Local development with DevTools
-------------------------------

[](#local-development-with-devtools)

Install the DevTools release PHAR and use this layout:

```
server/
|- plugins/
|  |- DevTools.phar
|  `- BlockDataExample/
|- virions/
|  `- BlockData/
`- build/

```

Restart the server, then run:

```
/devtools virions
/devtools doctor BlockDataExample
/devtools build BlockDataExample

```

The result is `build/BlockDataExample.phar`.

Usage
-----

[](#usage)

Place a block to save its owner and placement time. Run `/inspect`, then right-click a block to display its saved data. Run `/inspect` again to disable inspection mode.

Only the recorded owner may break a tracked block unless the player has `blockdata.bypass`.

Permissions
-----------

[](#permissions)

PermissionDefaultPurpose`blockdata.command.inspect`EveryoneUse `/inspect`.`blockdata.bypass`OperatorBreak blocks owned by another player.Source integration
------------------

[](#source-integration)

The complete integration is in `src/BlockDataExample/Main.php`. The essential setup is:

```
use NhanAZ\BlockData\BlockData;

protected function onEnable() : void{
    $this->blockData = BlockData::create($this, autoCleanup: false);
}
```

See the [BlockData documentation](https://github.com/NhanAZ-Libraries/BlockData) for the complete API.

###  Health Score

24

—

LowBetter than 30% of packages

Maintenance63

Regular maintenance activity

Popularity2

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.7% 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/737e9f0e23b56164d8e08729d58be66b69dc994c6b2bfa3c71b4efe4b231d785?d=identicon)[NhanAZ](/maintainers/NhanAZ)

---

Top Contributors

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

---

Tags

blockdataexamplephppluginpmmppocketmine-mp

### Embed Badge

![Health badge](/badges/nhanaz-blockdata-example-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/nhanaz-blockdata-example-plugin/health.svg)](https://phpackages.com/packages/nhanaz-blockdata-example-plugin)
```

###  Alternatives

[k1low/holiday_jp

Japanese holidays

2033.0k](/packages/k1low-holiday-jp)

PHPackages © 2026

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