Build a randomly generated dungeon, with 8 different path shapes! This is just a know-how of how it can be done, it does not add anything to the vanilla gameplay and should not be used as-is.
It works by comparing every possible direction to choose if there is a shape that can connect to existing tiles, if none a random one will be choosen. Every tile is 16x16 and under it there are blocks of concrete on each side. Yellow concrete means that there is a wall on that side, the pink one means that there is a door.
Tested on 1.19.41. Multiplayer compatible!