PHP: public function onClick(PlayerInteractEvent $event){ $player = $event->getPlayer(); } how to set item ID and sendMessage on this?
What do you want to accomplish? PHP: $player->sendMessage("Your message"); As for "set item ID", it doesn't make sense in this context without further explanation.
sure, here you go PHP: $player->getInventory()->setItem(0, \pocketmine\item\ItemFactory::get(\pocketmine\item\ItemIds::DIAMOND_SWORD));
Hello, i think you want to add item in to player inv? for do this you need this code: PHP: public function GodWeedZao(PlayerInteractEvent $event) { $event->getPlayer()->getInventory()->addItem(Item::get(Item::DIAMOND, 0, 10)); // this will add items to player inventory (10 diamond). $event->getPlayer()->sendMessage("This is a Test !"); //sending msg to player }