Minecraft – Can you make lava that continues flowing on a flat surface indefinitely

minecraft-commandsminecraft-java-edition

Is there a way to make it so that when you place a lava bucket it doesn't stop flowing? I'm just doing this for fun but I would like to know. I would prefer if the answer could use something like /give and be used in a command block because I want to make it so you can just press a button to give it to the player. Any other method is fine, though.

Best Answer

This is not possible in vanilla, but a datapack mimicking similar behavior is possible.

First, setup a scoreboard objective tracking the placement of lava buckets. When a player's score increments (meaning they have placed a lava bucket) use raycasting to determine which block the lava is at. Then, run a recursive function at that block that checks for a suitable (adjacent at a lower or equal y level) air/cave_air block to set to lava, and then executes the recursive function at those newly placed blocks. If the lava is placed in a bowl or underground in a closed cave system it will stop spreading, but if you placed it on a flat world it would instantly cover the entire loaded world in lava.