How can you make a block/structure/plant spawn on top of a Cave Biome's roof?

Started by Minecraft_guy881 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can you make a block/structure/plant spawn on top of a Cave Biome's roof?

How can I make it so that a block/structure/plant can spawn on top of the roof of a cave biome with procedures? I have ZERO coding experience.

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It's just kind of difficult…
Sat, 10/14/2023 - 13:48

It's just kind of difficult to get stuff to generate underground, period. Not impossible, but annoying with the built in tools. Surface structures are easy enough, but getting something to properly distinguish between air and solids underground is a pain.

In the past, I've done these sort of biome features using procedures. You'll want to make a sort of void structure, (a structure consisting entirely of air, structures that consist entirely of structure voids annoyingly don't save), that runs a procedure when it's placed underground.

For the procedure, you want to replace the block at x/y/z with the block above x/y/z, (essentially disguising the origin of the structure- yes this is not a great workaround), then search for valid locations for your feature within a certain radius. You can use the 'check for block in 6*6*6 box' procedure template, but reconfigure it to have a larger radius, (by changing the numbers), and to alter blocks instead of just checking them. (In this case, you'll want to change it to check if the block at the offset location is stone or something, and has air below it, and, if it is, place your custom feature there.) You will likely want to add some random chance here as well, as by default, this will target every block within the specified radius. 

...Essentially, you're making a structure that checks the nearby area for places to place your feature, greatly increasing the odds of it generating. You'll still need to turn up structure likelihood pretty high though, if you want to see it on a regular basis.