I need to scatter a specific floating-island structure (stored in a structure file in a datapack) randomly throughout the overworld, so that there is one island approximately every 1000 blocks in any direction. I know that I'll need to run a function to place the structure blocks for the structure at the position of armorstands, which are flung out across the world using
/spreadplayers, but I don't know how to make them "generate in" naturally when the player enters new chunks. The
/spreadplayers command allows me to spread a number of armorstands over an area with a minimum distance in between them, but I can't just do it out to the world limit.
The chunk format wiki page has tags for how long a chunk has been inhabited by players and stuff like heightmaps to know if the island will conflict with a mountain (I would prefer to only spawn the islands in in low-lying places for maximum effect), but I don't know of any way to access them dynamically ingame. Assuming I could test the
InhabitedTime: of a chunk, I still don't really know how that might help me accomplish this: I just put it in here in case it gives anyone else an idea.
I'm really quite stuck and any help on how to do this would be appreciated.