Unmodified Minecraft won’t allow you to place rails on water, although in some cases it is very necessary. The same applies to lava and any other liquids. What do you have to do? Don’t be in a hurry to be sad, but rather install Floating Rails which makes it possible to put rails and ride a minecart right on the water.
Created by EwyBoy
How Floating Rails Works
Two types of rails will be added to Minecraft. They have the same structure with vanilla rails but with one difference. The rails are on the lily which doesn’t allow them to sink or move. By connecting all the rails in a single way, you can fearlessly ride a minecart through the water without underwater columns or supports.
For lava there is a second type of rails based on the bedrock lily. For everything to work the Floating Rails Mod adds the rest of the rails and tools for building a real surface railway.