Hi developpers! I used PHP: /** * I defined below * @param Level $level * @param Player $player * @param Block[] $blocks */$level->sendBlocks([$player], $blocks); because I read this thread and wanted to do the same, but it does not work. Does an alternative method exist?
No, I dont want to send a block entity. What I want to send is an apparent fake block for a single player.
PHP: $packet = new \pocketmine\network\mcpe\protocol\UpdateBlockPacket;$packet->x = $x;$packet->y = $y;$packet->z = $z;$packet->blockId = $blockId;$packet->blockData = $blockDamage;$player->dataPacket($packet);
Thank you, that code worked. However, clicking will cause the chunk to be reloaded and disappear. Is there a way to avoid it?
Listen to PlayerInteractEvent when action = PlauerInteractEvent::LEFT_CLICK_BLOCK and send the packet during the event also.