error in task help code... $player->getScheduler()->scheduleRepeatingTask($this, 2); --------------------------------------------------------------------------------------------------------------------------------------------- class BlockReplaceTask extends Task { /** @var Block $block */ private $block; /** @var Player $player */ private $player; /** @var Plugin $plugin */ private $plugin; /** * @param Block $block * @param Player $player */ public function __construct(Block $block, Player $player) { $player->getScheduler()->scheduleRepeatingTask($this, 2); $this->block = $block; $this->player = $player; } /** * Actions to execute when run * * @param int $currentTick * * @return void */ public function onRun(int $currentTick) { $this->block->getLevel()->sendBlocks([$this->player], [$this->block]); unset($this->player, $this->block); } }
exe public function sendRealBlock(Player $player) { $block = $this->getReplacementBlock(); if($block instanceof Block) { new BlockReplaceTask($block, $player); } }