Hi! I'm not sure how to make getContents() work. If anyone know who please let me know... My Code: PHP: public function onJoin(\pocketmine\event\player\PlayerJoinEvent $e) { $inv = $e->getPlayer()->getInventory()->getContents(); if($inv === \pocketmine\item\Item::get(338, 0, 1)) { $this->getLogger()->info('no'); // helps to tell if the line gets executed } } Thanks
getContents() returns an array of the items in the inventory. If you want to check if a player has a certain item, I recommend using $inventory->contains();