#prevent lava from filling caves

1 messages · Page 1 of 1 (latest)

marble topaz
#

so Im currently working on a datapack that makes minecraftharder. So I replaced the main fluid in the overworld with lava. The problem is that every single cave is now filled with Lava. Is there any way to prevent this?

stiff pollen
#

You need to repurpose the aquifer density functions so that no caves become aquifers (which is essentially what's happening)

marble topaz
#

how do i do that?

stiff pollen
#

You can make the fluid_level_floodedness density function in your noise_settings -1, so that aquifers never fill with fluid. You'll just need to also ensure your initial_density_without_jaggedness is set up accurately or it may also un-flood your oceans

marble topaz
#

ok ill try that

#

which part of the initial_density_without_jaggedness needs to be changed?

#

nothing changes even after changing the fluid_level_floodedness and generating a new world.

stiff pollen
#

It just needs to accurately represent the surface of your terrain so that everything roughly below it is greater than 0, and everything above it is 0 or less

#

Typically it's just very similar to your final density, but shifted down a few blocks and without any of the density functions that handle noise caves

marble topaz
#

ok

#

changed it but it still fills all the caves with lava

stiff pollen
#

Show your work

marble topaz
#

how do i stop it from being normal text? in Discord

proud pebble
#

you can add ``` before and after the text block

marble topaz
#

thx

proud pebble
#

so smth like this:

#

<your_code>

marble topaz
#
    "fluid_level_floodedness": {
      "type": "minecraft:noise",
      "noise": "minecraft:aquifer_fluid_level_floodedness",
      "xz_scale": -1.0,
      "y_scale": -1
    },
#

in the file data/minecraft/worldgen/overworld.json

#
"initial_density_without_jaggedness": {
      "type": "minecraft:add",
      "argument1": 0.1171875,
      "argument2": {
        "type": "minecraft:mul",
        "argument1": {
          "type": "minecraft:y_clamped_gradient",
          "from_value": 0.0,
          "from_y": -54,
          "to_value": 1.0,
          "to_y": -50
        },
        "argument2": {
          "type": "minecraft:add",
          "argument1": -0.1171875,
          "argument2": {
            "type": "minecraft:add",
            "argument1": -0.078125,
            "argument2": {
              "type": "minecraft:mul",
              "argument1": {
                "type": "minecraft:y_clamped_gradient",
                "from_value": 1.0,
                "from_y": 230,
                "to_value": 0.0,
                "to_y": 246
              },
              "argument2": {
                "type": "minecraft:add",
                "argument1": 0.078125,
                "argument2": {
                  "type": "minecraft:clamp",
                  "input": {
                    "type": "minecraft:add",
                    "argument1": -0.703125,
                    "argument2": {
                      "type": "minecraft:mul",
                      "argument1": 4.0,
                      "argument2": {
                        "type": "minecraft:quarter_negative",
                        "argument": {
                          "type": "minecraft:mul",
                          "argument1": "minecraft:overworld/depth",
                          "argument2": {
                            "type": "minecraft:cache_2d",
                            "argument": "minecraft:overworld/factor"
                          }
#

the message limit was too long but there are a few closed brackets and "max": 54 and "min:-64 left

stiff pollen
#

No {} necessary for that

marble topaz
#

ok ill try that

#
    "fluid_level_floodedness": {
      "type": "minecraft:constant",
      "argument": -1
    }
#

thats what i got with misode but it still has {} these

stiff pollen
#

That's fine

#

It's unnecessary but it should work

marble topaz
#

still generates like this

stiff pollen
#

Though most of the world would appear to have a positive value, so it in theory should still be removing all the fluid

#

Just for testing purposes, try making it water instead

marble topaz
#

the main fluid right?

stiff pollen
#

The default fluid, yes

marble topaz
#

ok done

stiff pollen
#

And?

marble topaz
#

loading new world

#

huh every cave is now flooded with water. That didnt happen before

stiff pollen
#

Well that makes sense, because they were flooded with lava before...

#

All you did was change the fluid, we were just making sure that water wasn't treated differently from lava for aquifer purposes

marble topaz
#

oh i meant before changing it for the first time the caves werent filled with water

#

wait no not all caves i just saw a natural water cave. the caves arent filled with water

stiff pollen
#

There shouldn't be natural water caves either (as I have said, the entire point of what I'm recommending is to remove those entirely), but it does sound like water gets treated differently from lava

marble topaz
#

is there any way that you can think of to get around the different behaviour of water and lava?

stiff pollen
#

You'd have to use features to replace the lava with air

#

The current tech is to use 4 disk features per subchunk, that are at the max size and are positioned in roughly the corners of each of those chunks so as to cover most/all blocks, which are able to only replace lava with air

marble topaz
#

ill try this but it could take a moment