A simple PocketMine-MP plugin that shows how to use the BlockData virion by attaching extra information to blocks.
This plugin is mainly a demo/example, not a full protection system.
- Remembers who placed a block
- When a player places a block, the plugin stores:
- The player name
- The time the block was placed
- When a player places a block, the plugin stores:
- Only the owner can break the block
- If another player tries to break it, the break is cancelled (unless they have a bypass permission).
- Lets you inspect block info
- Players can toggle an "inspect mode" and right-click a block to see:
- Who placed it
- When it was placed
- Players can toggle an "inspect mode" and right-click a block to see:
All of this data is stored using the BlockData library — see the main repo:
https://github.com/NhanAZ-Libraries/BlockData
- PocketMine-MP API
5.0.0or newer - The BlockData virion (library) loaded for this plugin
(GitHub: NhanAZ-Libraries/BlockData)
- Download or build the
BlockDataExampleplugin.phar. - Make sure the BlockData virion is correctly included in your server setup.
- Put the
.pharfile into your serverpluginsfolder. - Start (or restart) your PocketMine-MP server.
If everything is correct, you should see BlockDataExample enabled in the console.
-
Place blocks
- Simply place any blocks as usual. Placement info will be saved automatically.
-
Inspect block data
-
As a player, run:
/inspect -
You will see a message saying inspect mode is enabled.
-
Right-click a block:
- If it has data, you will see the owner name and placed time.
- If not, it will say the block has no data.
-
-
Break blocks
- The block can only be broken by its owner (or players with the bypass permission).
blockdata.bypass
Allows a player to break blocks regardless of who placed them.
You can give this permission to admins or trusted staff if you want them to ignore ownership checks.
- This plugin is intentionally small and simple so you can:
- Read the code easily (see
src/BlockDataExample/Main.php). - Learn how to integrate and use the BlockData virion in your own plugins.
- Compare with the official BlockData documentation here:
https://github.com/NhanAZ-Libraries/BlockData
- Read the code easily (see