PHPackages                             davycraft648/pminputapi - 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. davycraft648/pminputapi

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

davycraft648/pminputapi
=======================

PocketMine-MP virion designed to detect player input and various input modes

1.0.1(11mo ago)46[3 issues](https://github.com/DavyCraft648/PMInputAPI/issues)MITPHP

Since Jun 20Pushed 11mo agoCompare

[ Source](https://github.com/DavyCraft648/PMInputAPI)[ Packagist](https://packagist.org/packages/davycraft648/pminputapi)[ RSS](/packages/davycraft648-pminputapi/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (4)Used By (0)

PMInputAPI Virion
=================

[](#pminputapi-virion)

PMInputAPI is a virion for [PocketMine-MP](https://github.com/pmmp/PocketMine-MP) that aims to bring a subset of the Input API functionality, similar to what is found in Minecraft Bedrock Edition's Script API, to PocketMine plugins. This virion is designed to provide plugin developers with structured ways to interact with player input, such as movement controls, button states, and input modes, making it easier to create immersive and responsive experiences.

---

Features
--------

[](#features)

- **Player Input Permissions Control:** Enable or disable specific player input categories like `Camera`, `Movement`, `Jump`, `Sneak`, and more.
- **Player Input Information:** Access details about a player's current input, including their last used `InputMode`, whether touch input affects only the hotbar, and the state of `Jump` and `Sneak` buttons.
- **Movement Vector:** Retrieve the raw movement vector of the player.
- **Event Listeners:** Register custom listeners for changes in player input permissions and input mode changes.

---

How to Use This Virion (For Developers)
---------------------------------------

[](#how-to-use-this-virion-for-developers)

As a [**virion**](https://poggit.pmmp.io/virion), PMInputAPI is not a plugin you install directly. Instead, it's a library that other plugins *include* in their code.

### Including PMInputAPI in Your Plugin

[](#including-pminputapi-in-your-plugin)

- Using **Composer** (virion v3):

    Add this as a dependency to your Composer project. Open your terminal in your project's root directory and run the following command:

    ```
    composer require davycraft648/pminputapi
    ```

    After running the command, your `composer.json` file will be updated. You can inspect it to see the new dependency listed, similar to this:

    ```
    {
      "require": {
        // other dependencies ...
        "davycraft648/pminputapi": "^1.0"
      }
    }
    ```
- Using **Poggit CI** (virion v1):

    Add this to your `.poggit.yml` file:

    ```
    projects:
      YourPlugin:
        libs:
          - src: DavyCraft648/PMInputAPI/PMInputAPI
            version: ^1.0.1
    ```

### Registering the Virion

[](#registering-the-virion)

Your plugin must register the `PMInputAPI` virion during its `onEnable()`. This ensures the necessary managers are initialized.

```
