[Mod] Waterworks (pipes, pumps and valves) 0.1

Posts: 447
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

[Mod] Waterworks (pipes, pumps and valves) 0.1

by FaceDeer » Sun Jul 07, 2019 20:44

I actually posted this mod some time ago, but it seems the forum crash ate that post so I'm making a new one.

This mod provides a set of nodes that allow large quantities of water to be pumped from one place to another, potentially over very long distances.

Important Note: The default behaviour of water in Minetest does not actually lend itself well to this kind of activity. In particular, default:water_source has liquid_renewable = true set in its node definition, which often causes new water nodes to be created where old ones are removed.

This mod includes an optional setting that disables liquid_renewable for default water, but for best effect it is highly recommended that this mod be used in conjunction with the dynamic_liquid mod.

The airtanks mod can also be helpful for players who are interested in doing large-scale underwater construction projects.

A pipe network is only active when a player is near one of the terminal nodes attached to it. The map blocks containing all terminal nodes for the network will be forceloaded as long as the pipe network is active, allowing water to be added or removed from remote locations, but note that water will be unable to flow into or out from those remote map blocks into adjoining blocks so it may behoove a player to visit these places from time to time to ensure continued flow.


The core node type introduced by this mod is the pipe. When pipes are laid adjacent to each other they connect up to form a pipe network, to which inlets, outlets, and pumps can be connected. All contiguous pipes are part of the same network, and all terminal nodes connected to that network will be able to interact with each other through the pipes.

Pipes automatically connect to other pipes through any of their six faces.


Terminals can only be connected to a pipe network via one face, the side that by default is facing away from the player when they place the node in world. They interact with water only on the opposite face - the one facing toward the player when they place the node in world. Terminals require at least one pipe segment to connect to, they don't interact directly with each other.

A screwdriver can be used to reorient terminals if you want one facing upward or downward.

The types of terminals in this mod are:

  • Inlets let water enter the pipe but not leave
  • Outlets let water out but not in
  • Grates let water flow either way depending on pressure
  • Pumps are inlets that force water into the network at a higher pressure than their elevation would normally give it.


A valve can be used to connect or disconnect sections of a pipe network with a simple right-click. When a valve is "open" it acts like a pipe section, and when it's "closed" it does not act like a pipe.

Elevation and pressure

The flow of water through the network is determined by two main factors; the directionality of each type of terminal, and the pressure of the water at that terminal.

Water flows from high pressure terminals to low pressure terminals. The rise and fall of the pipe in between those two terminals doesn't really matter, just the pressure at the terminals themselves.

The following figure illustrates the basics of how this works with a very simple three-terminal pipe network:


The two terminals on the left side are "inlets", only permitting water to enter the network, and the terminal on the right is a grate that allows water in or out.

If terminal 1 were to be immersed in water, water nodes would be transferred from terminal 1 to terminal 2 because terminal 1's higher elevation gives it higher pressure than terminal 2. Water would not be transferred to terminal 3 as terminal 3 is an inlet only.

If terminal 2 were to be immersed, likewise no water would be transferred because although terminal 2 can allow water to enter the pipe (it's a grate) there are no valid outlet terminals it could go to.

If terminal 3 were immersed in water, no water would be transferred because terminal 2 is higher elevation and therefore there isn't enough pressure at terminal 3 to reach it.


In this example terminal 3 is a pump, which acts as if it were an inlet located at an elevation 100 meters higher than it actually is. There are two potential outlets for water entering the system. Water is preferentially emitted from the lowest pressure outlet, so if terminal 3 was immersed in water it would be sent to terminal 2. However, if terminal 2 was contained in an enclosed space that had run out of room for additional water, the water would then be sent to the next-lowest outlet and come out of terminal 1.

If terminal 1 was immersed, then water would transfer from it to terminal 2. Terminal 3 is an inlet, so water wouldn't come out of it.


This mod is released under the MIT license.

Posts: 280
Joined: Sun Jun 16, 2019 20:17
Location: Earth

Re: [Mod] Waterworks (pipes, pumps and valves) 0.1

by Red_King_Cyclops » Tue Jul 09, 2019 15:47

There already is a widely used pipe mod, called "pipeworks." Your mod looks good, but you should justify the need for its existence. It might be better than pipeworks, anyway.
My best mods: space_travel, time_travel, and rocket.

User avatar
Posts: 713
Joined: Thu Mar 24, 2016 03:19
Location: Right behind you.
GitHub: v-rob

Re: [Mod] Waterworks (pipes, pumps and valves) 0.1

by v-rob » Tue Jul 09, 2019 18:15

There are two differences from pipeworks that I can see: First off, water can flow anywhere in Pipeworks, whereas this one takes a more realistic approach with gravity and pressure affecting where the water can go. Second off, Pipeworks is a much bigger mod which also includes tubes and suchlike, so this one is more specialized with its use, limited to pure water moving.

I do hope that this mod can support multiple liquids, e.g. river water, lava, and oil. This is one of the major shortcomings of both Pipeworks and this mod.

Posts: 447
Joined: Sat Aug 29, 2015 19:01
GitHub: FaceDeer

Re: [Mod] Waterworks (pipes, pumps and valves) 0.1

by FaceDeer » Tue Jul 09, 2019 21:21

I do have plans to support other liquid types, and also more sophisticated pumping (currently you can't easily use pumps to raise liquids more than 100 meters above the input). This is just the basic "it's alive! It's alive!" version, hence the "0.1" version number. :) I'm also planning optional Technic integration to allow the pumps to require energy to operate, and to allow the valves to be controlled by remote control signals. Let me know if any of those are locking you from using this on your own server and I could prioritize them next time I get to working on this mod (I've been tinkering with other stuff in recent weeks).

It's been a little while since I dug around in the Pipeworks water pipe system but as I recall I found it not particularly useful for my purposes since it was written assuming the default water behaviour (source nodes don't move and they regenerate infinitely). I always play with dynamic_liquid enabled so I wrote this with dynamic_liquid as the base assumption instead, that way I know it'll work the way I need it to.

Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 1 guest