This repository is a small PocketMine-MP example plugin for the ReinfyTeam/libpf profanity-filtering library. It demonstrates how a consumer can inspect chat messages, cancel a message containing a configured word and replace profanity before sending the message onward.
- PocketMine-MP API
5.0.0, as declared by the currentplugin.yml. - PHP 8.1 or newer for development checks.
- The
ReinfyTeam\libpf\libpfAPI supplied through the consumer's supported library/Virion workflow.
This repository is an example consumer, not the library itself. Its API 5 manifest matches the current consumer code and the Composer development dependency used for analysis. The library remains a separate Virion dependency and must be packaged with the plugin.
The plugin registers a chat listener and uses libpf::defaultProfanity() with libpf::detectProfanity(). When a match is found, it warns the player, cancels the original event and applies removeProfanity() and removeUnicode() to the replacement message. Review this behavior before using the example as a moderation policy in production.
Install the locked development dependencies and run the available checks:
composer install
vendor/bin/phpstan analyse -c phpstan.neon.distThe repository uses a small tools/stubs/libpf/ declaration for static analysis. A real consumer should load the actual library through its supported packaging flow and should test the resulting behavior on the target PocketMine-MP API.
For library API questions, see the libpf repository. For example-plugin issues, open an issue with the plugin revision, server version and relevant logs.
The example plugin is licensed under MIT and preserves the ReinfyTeam author credits from the project metadata. This license applies to the example consumer; it does not replace the license of the libpf library.