Skip to content
 
 

Repository files navigation

pmforms

Form API library for PocketMine-MP plugins

CI License Discord

Compatibility

  • PHP 8.1 or newer
  • PocketMine-MP API 5.x
  • Axolotl-PM 5.51.1 for development analysis and DevTools integration

Include in a plugin

Use the repository as a local development virion with DevTools. Put the checkout in virions/pmforms/ and declare it in the consuming plugin's devtools.yml:

virions:
  - name: pmforms
    version: ^2.3.1

DevTools uses the shared source during development and injects the virion into the consumer PHAR during the build. The production server does not need DevTools installed for the resulting plugin.

Demo plugin

examples/DevToolsConsumer/ is a runnable demo plugin adapted from the upstream pmforms-demo. It demonstrates MenuForm with a URL image, ModalForm, CustomForm, form close callbacks, custom form elements, and reading typed values from CustomFormResponse.

Run one of these commands in game to open a form:

/form menu
/form modal
/form custom

You can also target online players by name, for example /form custom Steve. The same example is built and analyzed with DevTools in CI, using the devtools.yml beside its plugin.yml.

Develop with DevTools

The root virion.yml lets Axolotl-PM DevTools load this checkout as a shared development virion. Put the repository at virions/pmforms/, then declare it in the consuming plugin's devtools.yml:

virions:
  - name: pmforms
    version: ^2.3.1

DevTools uses the shared source during development and shades the library into a standalone plugin PHAR when building. The production plugin does not need DevTools installed. The demo plugin is also the DevTools consumer example, built and analyzed in CI.

Development checks

composer install
composer validate --strict
composer analyse

PHPStan runs at level max against Axolotl-PM 5.51.1.

Attribution

The original author is dktapps. AxolotlBucketLabs maintains this fork for Axolotl-PM API 5.

Releases

Contributors

Languages