Is it possible to spawn a block using AddEntityPacket. I tried @Muqsit plugin: https://github.com/Muqsit/Hats But it didn't work.
It's possible, or at least, it was. I accidentally spawned a piston block a year and a half or so ago while trying to create floating text. I'll try to find some source as proof, but I haven't had any luck yet.
FloatingTextParticle is an entity, a block entity, with the ID 0 (air). Just spawn this entity: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/object/FallingBlock.php And use $pk->block = new Stone; or Block::get(Block::STONE); This would work. Hope I helped.
Wrong. Floating text particles are invisible human entities. And your second part is invalid. KHAV would like to use AddEntityPacket. The method for spawning a falling block entity with AddEntityPacket is to send the block variant through the metadata property of AddEntityPacket. Here's an example: PHP: $pk = new AddEntityPacket(); $pk->entityRunTimeId = Entity::$entityCount++; $pk->type = FallingBlock::NETWORK_ID; $pk->position = $player->add($player->getDirectionVector()); $pk->motion = new Vector3(0, 0, 0); $pk->metadata = [Entity::DATA_TYPE_INT => [Entity::DATA_VARIANT, BlockFactory::toStaticRuntimeId(Block::STONE)]]; $player->sendDataPacket($pk);
I'm not sure if scale affects falling block entities, but you could try. https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Entity.php#L130