Started by
kolokythi
on
Topic category: Help with Minecraft modding (Java Edition)
so i want to make a sturcture spawn underwater and fill with water/other whatever liquid it spawns in however when i attempted it it spawned with an air bubble surrounding it. so i added water inside and all around the structure but now if it pokes out the water theres just a bump of water floating there how do i fix this?
I think that the easiest way to fix that is to use structure voids instead of air/water in your structure, as the structure voids effectively tell the game not to replace whatever would otherwise be there. So if it generates underwater, it will be filled with water, and if it generates on the surface, it will be filled with air. The downside to structure voids is that it could also be replaced by a solid block, such as sand, so I have an idea for a more complex alternative solution.
The more complex way that would keep dirt and sand out of your structure would be to create your own invisible block with no bounding box, and have it tick randomly. Then fill your structure with the invisible block and save the structure. After the structure has been saved, create the following procedure:
If Y > 63
Do: place [water] at X Y Z
Else: Place [air] at X Y Z
Then, set that procedure to the custom block's update tick procedure trigger, and the block's on neighbor block update procedure trigger. If your structure is at least 4x4x4, the update tick with random ticking will pretty quickly update your block, then it will change and update all of the other custom blocks in the structure.
You may need to tweak the Y > 63 value to be whatever the sea level is, but the ocean and rivers in Minecraft are always at the same height in any given dimension, so once you find a number, it should work in pretty much every location.
I hope that helps.
cheers