Hello everyine, today i tryed to make tnt tag minigame, i tryed to get inventory itmem with a task but won't work!!! Code: <?php namespace Core\Games\TnTTag\Task; use pocketmine\scheduler\Task; use pocketmine\Server; class TnTTagTnTGrabTask extends Task { public $time = 30; public function onRun(int $currentTick) { foreach (Server::getInstance()->getLevelByName('TNT-TAG-MAP-1')->getPlayers() as $player) { if ($player->getInventory()->getItemInHand()->getId() === 46) { if($this->time <= 30 && $this->time > 29){ $player->sendMessage("3000"); }elseif($this->time <= 29 && $this->time > 15){ $player->sendMessage("u noooo test ob"); }elseif($this->time < 15 && $this->time >= 0){ $player->setGamemode(3); } } } $this->time --; } } and to start task Code: if ($player->getInventory()->getItemInHand()->getId() === 46) { Server::getInstance()->getScheduler()->scheduleRepeatingTask(new TnTTagTnTGrabTask(), 20); } i tryed with switch tooo but nothing!