Topic category: User side tutorials
This tutorial-ish thing is meant to show you how I made cave biomes in my mod Upcave, so you can add some to your own mods.
First download this tutorial mod by clicking on this green text. The tutorial mod adds one of the biomes from Upcave, as an example of how to do this. I forgot to delete my test worlds when creating this base mod, so have fun with those, I suppose. Have fun judging my choice to name multiple worlds "scree"
Now that you have the mod I will walk you through what every element does. Even the unimportant ones. If you think you can figure it out on your own, have fun. Feel free to use it as a base for your mods.
Fungal moss: (block)
Its just an underground type of grass exclusive to the cave biome. It is not required to generate cave biomes, and is just decoration
Just a type of mushroom that appears to decorate the cave. Not important.
Fungal Moss Floor: plant)
Just some more decoration for the cave. Not important.
Hanging Fungal Moss: (block)
An example of how i made the hanging blocks, like stalactites in the mod. Not really important, but may help you understand how to make your own hanging plants.
Hanging Fungal Moss Neighbour Block Changes: (procedure)
Detects if the block above it is broken, then breaks it's self it it is. This is used on the Hanging fungal moss.
Fungal Air: (block)
This is the block that actually spawns the cave itself. it does this through running the procedure "Fungus Air" every time the block is updated
Fungus Air: (Procedure)
Checks if the cave's spawning conditions are met (In this case, is it under y level 40), then if it is it will use the procedure "Fungal Air Update Tick" on each and every block in a 65x17x65 area around it. It then deletes itself by placing stone where it once was
Fungal Air Update Tick: (Procedure)
This block checks it's nearby surroundings to see if this is a valid place to place Fungal moss, Toxishroom, Fungal Moss Floor, or Hanging Fungal Moss. This procedure only checks for the block it is being used at. Fungus Air makes sure this is used on every block in the cave biome, as previously said. The combination of these 2 are what causes the biome to look like how it looks.
Fungal Cave: (Structure)
This spawns in an underground structure, which is always just a single Fungal Air Block. This determines how common the cave biome will be. The reason I used this, rather than just making Fungal Air operate as an ore is because when I make it spawn as a structure I can have it use the procedure "Cave" instantly upon spawning, meanwhile if it were an ore i would have to wait for random ticks to spawn the cave for me. Some players would already be exploring the caves by the time random tick spawns the biomes.
Forces Fungal Air to do a tick update right away, rather than waiting for random tick to deal with it. Without this it would take up to a minute for cave biomes to spawn. With this, they spawn 1 second after their surrounding terrain is generated. There is no reason why this is set to 1 full second.
Those are all the elements of this base mod explained. Hopefully you now understand them well enough to be able to make your own unique cave biomes. Sorry if I left you confused. Im not very good at explaining things.