Long road generation

Started by SwordShattered on

Topic category: Help with modding (Java Edition)

Last seen on 00:53, 18. Oct 2023
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Long road generation

For my mod dimension, I want to have one extremely long road that generates in a straight line with structures that spawn beside it. How can I do this?

Last seen on 20:37, 26. Jul 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
...Depends on how…
Sun, 10/01/2023 - 14:39

...Depends on how complicated you want to make it? 

You'll need some custom modded blocks to constantly generate a road in both directions. Place one of them at the player's position when they enter the dimension, and have it generate a road structure with more of the custom blocks on either end. (Thus continuously generating the road in both directions whenever new chunks are loaded.) If you want it to eventually stop, you can use the distance from origin as an indicator of how long the road has gotten.

Depending on how you want the road itself to generate, (which could get quite complex depending on your dimension's terrain), you could wind up needing more custom blocks. 

For my roads, I essentially use something to target each block in a rectangular shape at world surface, and replace them with  my desired block. (In my case, randomly selected blocks to make the road textured.) This is also configured to make the road thin out the further it goes. (As the offset gets higher.) Again, depends on your use case.