hello, I would like to know how to make sure that any person holds an Item in the hand this one and will be famous
Bad English... PHP: $itemIdGoesHere = 5;foreach($this->getServer()->getOnlinePlayers() as $player){ if($player->getInventory()->getItemInHand()->getId() === $itemIdGoesHere){ $player->sendMessage("You are famous"); }}
PHP: use pocketmine\item\Item; PHP: $name = "Enter Custom Name here!";$item = Item::get(Item::DIAMOND_SWORD);$item->setCustomName($name);