How can I set a item to a slot? For example: $inv->addItem(clone $item); Will add the item, but how can I set the slot?
Try: PHP: $inv->setItem($slotId, $someItem); http://docs.pocketmine.net/d5/dc4/classpocketmine_1_1inventory_1_1_base_inventory.html
PHP: public function interact(PlayerInteractEvent $event){ $x = $event->getBlock()->getX(); //and so on..}