I doubt you actually have to code the particles to 'move' themselves. I think spawning random particles around the block will automatically make them move to the ender chest. That's my guess because particles aren't controlled server side.
To create portals around a block, simply get the XYZ and spawn them. There is various code for making a circle/patterns etc. Use a task if you want them to keep respawning
Using lcg_value() as done in LBParticles would answer the question, but it would be better if there was a way to spawn an invisible, yet visible (visible as in the particles would be visible) ender chest. Try this PHP: public function spawnEnderChestParticles(Position $pos){ $pk = new BlockEntityDataPacket(); $floored = $pos->floor(); $pk->x = $floored->x; $pk->y = $floored->y; $pk->z = $floored->z; $players = $pos->getLevel()->getChunkPlayers($floored->x >> 4, $floored->z >> 4); if(!empty($players)){ $nbt = new NBT(NBT::LITTLE_ENDIAN); $nbt->setData(new CompoundTag("", [ new StringTag("id", "EnderChest"), new IntTag("x", $floored->x), new IntTag("y", $floored->y), new IntTag("z", $floored->z) ])); $pk->namedtag = $nbt->write(true); $pos->getLevel()->getServer()->broadcastPacket($pk, $players); }}
Keep in mind LBParticles doesn't appear to be licensed permissively, so take care when copying code from there.