I want to know how I delete all inventory item and how to add items in slot or in inventory I want to know if I can add potion item because I researched in https://github.com/pmmp/PocketMine-MP/tree/stable/src/pocketmine/item and I see many things about item complicated for me even about enchants things. someone help me how to call these things.
take a look at https://github.com/pmmp/PocketMine-MP/blob/stable/src/pocketmine/inventory/BaseInventory.php https://github.com/pmmp/PocketMine-MP/blob/stable/src/pocketmine/item/Potion.php
Thank for that!! I understand now how to clear item by " getInventory()->clearAll(); " and how to add or set item by " getInventory()->addItem(Item::get(1,0,1)); " and " getInventory()->setItem(0 ,Item::get(1,0,1)); " I also understand how to enchant by makeing item variable " $item = Item::get(1,0,1); " then give it the enchant like that " $item->addEnchantment(new EnchantmentInstance(Enchantment::getEnchantment($enchantnumber), 1)); " than addItem($item) with the same variable! what I really don't understand it is how to get potion . - I hope someone explain it for me after I do search I think I can't get it by coding but it's there in PocketMine and in the Server.