InventoryUI - the PocketMine virion that implements the dummy inventory

Overview

InventoryUI

This is the PocketMine virion that implements the dummy inventory.

Differences from previous APIs

  • Chests and other blocks are not placed.
  • If a player falls or moves by water or other means when the inventory is open, the inventory will not close.
  • You can specify any number of slots in your inventory. (Up to 1000 confirmed)
  • Vertical length of inventory slots can be specified. (max. 6)

How to install

  1. Download InventoryUIResourcePack.mcpack and put it in the resource_packs folder
  2. Open file resource_packs.yml, set force_resources to true and resource_stack to InventoryUIResourcePack.mcpack
force_resources: true
resource_stack:
  - InventoryUIResourcePack.mcpack

Usage

The following code must be called when the plugin is enabled.

InventoryUI::setup($this);

Open custom inventory

$slot specifies the number of slots in the inventory and must be a number greater than zero.
$title is the name of the inventory.
$length is entered as the vertical length of the inventory. If null, it is automatically adjusted.

/** @var Player $player */
$player->setCurrentWindow(new CustomInventory($slot, $title, $length));

Extend custom inventory

class SampleInventory extends CustomInventory {

    public function __construct() {
        parent::__construct(54, "Sample Inventory");
    }

    public function open(Player $player): void {
        // Called when a player opens this inventory.
    }

    public function tick(int $tick): void {
        // Called every tick when someone opens inventory.
    }

    public function click(Player $player, int $slot, Item $sourceItem, Item $targetItem): bool {
        // It is called when a slot in the inventory is operated.
        // If the return value is true, the operation is canceled.
        return false;
    }

    public function close(Player $player): void {
        // Called when the player closes the inventory.
    }
}

Sample plugin here

License

"InventoryUI" is under MIT License

Special Thanks

Help resource pack @famima65536

You might also like...
PHP Library that implements several messaging patterns for RabbitMQ

Thumper Thumper is a PHP library that aims to abstract several messaging patterns that can be implemented over RabbitMQ. Inside the examples folder yo

This library implements a fuzzer for PHP, which can be used to find bugs in libraries

PHP Fuzzer This library implements a fuzzer for PHP, which can be used to find bugs in libraries (particularly parsing libraries) by feeding them "ran

This package implements 0-1 Knapsack Problem algorithm i.e. allows to find the best way to fill a knapsack of a specified volume with items of a certain volume and value.

This package implements "0-1 Knapsack Problem" algorithm i.e. allows to find the best way to fill a knapsack of a specified volume with items of a certain volume and value.

A simple and fast pmmp js es6 promise virion

Promises A simple and fast pmmp js es6 promise virion Api usage these examples are in base injectable php these should be easily transferable. Example

[Virion] A library that helps you use Discord Webhook
[Virion] A library that helps you use Discord Webhook

DiscordHelper How to register Web Hook URL How to register Web Hook URL use NewThing\DiscordHelper\DiscordHelper; DiscordHelper::setURL($YourWebHookU

A plugin manager for PocketMine-MP downloads plugin from PocketMine-MP official plugin repository

oh-my-pmmp A plugin manager for PocketMine-MP Getting Started Prerequisites Your server MUST RUN the latest version of PocketMine. Installation From P

A PocketMine/Altay Plugin to morph yourself into a block
A PocketMine/Altay Plugin to morph yourself into a block

BlockMorph A PocketMine/Altay Plugin to morph yourself into a block Command To morph yourself into a block use this command: /blockmorph [BlockID|Bloc

A useful PocketMine-MP plugin that allows you to create crates in-game!

ComplexCrates A useful PocketMine-MP plugin that allows you to create crates in-game! Commands Main command: /crate Sub commands: create

A plugin to add more blocks to PocketMine

This plugin aims to add all blocks not included in PocketMine. As of right now the ExtendedBlocks plugin is required to add blocks with IDs above 255.

Owner
tedo0627
tedo0627
[virion] It Implements Simple Using Form Library System

SimpleForm [virion] It Implements Simple Using Form Library System How To Use First, declare the use statement. use AidenKR\SimpleForm\SimpleForm; use

Aiden 2 Sep 18, 2021
Windowy is a transaction-focused temporary inventory generator made for PocketMine-MP

About Windowy is a transaction-focused temporary inventory generator made for PocketMine-MP. How to use Windowy comes with 3 registered inventories us

DayKoala ʕ•ᴥ•ʔ 19 Aug 12, 2022
Container Open Inventory ID send bug fix PocketMine-MP plugin

ContainerOpenFixed Container Open Inventory ID send bug fix PocketMine-MP plugin Example use skh6075\containeropenfixed\IWindowType; use pocketmine\ne

avas 2 May 20, 2022
Cooldown Library (virion) for PocketMine-MP

libCooldown Cooldown Library (virion) for PocketMine-MP Example // libCooldown::newTimer(int $cooldown_time, bool $first_ignore = true): libCooldown;

null 4 Aug 9, 2022
A virion for PocketMine-MP.

libIPGeolocation A virion for PocketMine-MP. You can use this to get the geolocation of an IP from ip-api.com. Usage You can see some example in here:

Hsinwei Chen 3 Feb 14, 2022
PocketMine-MP virion for easy handling of ScoreBoard packets

PocketMine-MP virion for easy handling of ScoreBoard packets

pocketmine virions of avas 3 Apr 9, 2022
A virion for PocketMine-MP to create and manage fake blocks

?? fakeblocks Create and manage fakeblocks Description: A virion for PocketMine-MP to create and manage fake blocks. This virion indicates to the clie

null 13 Nov 16, 2022
UI virion (library) for PocketMine-MP plugins

Remark - Easy and Asynchronous Commands and Forms Quick Guide - Learn Remark by building a plugin. Install - Add Remark as a library to your plugin. E

DiamondStrider1 8 Jan 1, 2023
Inventory manager - Light Bootstrap Dashboard

Light Bootstrap Dashboard is an admin dashboard template designed to be beautiful and simple. It is built on top of Bootstra

Ranaivonampoizina Mikajy 1 Nov 17, 2021
Simple Plugin To Get EXP Directly To Inventory.

Simple Plugin To Get EXP Directly To Inventory.

HenryDM 6 Nov 21, 2022