InventoryGUI is a Altay and PocketMine-MP plugin that eases creating fake inventories!
First you choose inventory. InventoryGUI has two inventories, but you can create your own gui types.
use Enes5519\InventoryGUI\inventory\ChestInventory;
use Enes5519\InventoryGUI\inventory\DoubleChestInventory;
Let's say you chose DoubleChestInventory.
$inv = new DoubleChestInventory();
Your fake double chest inventory now ready. Now, let's fill this with some items.
$inv->setContents([
ItemFactory::get(Item::APPLE),
ItemFactory::get(Item::COMPASS)
]);
Let's send it to the player now.
$player->addWindow($inv);
Yup, that's it. It's that simple.
$inv->setCustomName("Custom Name");