Which packet could I use to create an mining animation like this: https://prnt.sc/kkmsmv I tried LevelEventPacket START BREAK, but it did just the first state. PHP: $pk = new LevelEventPacket(); $pk->evid = LevelEventPacket::EVENT_BLOCK_START_BREAK; $pk->position = $event->getBlock()->asVector3(); $game = $this->plugin->getGameOfPlayer($player); $game->playerone->sendDataPacket($pk); $game->playertwo->sendDataPacket($pk); $this->plugin->getScheduler()->scheduleDelayedTask(new BreakBlockTask($event->getBlock(), $game, 1, $this->plugin), 5);
You are missing the break time https://github.com/pmmp/PocketMine-...fcb961b85e482/src/pocketmine/Player.php#L2190 https://github.com/pmmp/PocketMine-...61b85e482/src/pocketmine/level/Level.php#L476 Yes LevelEventPacket::EVENT_BLOCK_STOP_BREAK just stops it
Thanks! This worked for me: PHP: $pk = new LevelEventPacket(); $pk->evid = LevelEventPacket::EVENT_BLOCK_START_BREAK; $pk->position = $event->getBlock()->asVector3(); $pk->data = (int)round(65535 / 60); $game = $this->plugin->getGameOfPlayer($player); $game->playerone->sendDataPacket($pk); $game->playertwo->sendDataPacket($pk);
how to freeze the animation, LevelEventPacket::EVENT_BLOCK_START_BREAK will remove the animation,not freezing it