Minimum distance from a water pipe to a junction box
Hmmm...  Assuming, from your use of 1/2&quot;, that you are in North America, it's actually something that people argue about (in the US anyway). Here is how the NEC reads in Article 110.34, Work Space and Guarding:

(F) Protection of Service Equipment, Switchgear, and Industrial
Control Assemblies. Pipes or ducts foreign to the electrical
installation and requiring periodic maintenance or whose malfunction
would endanger the operation of the electrical system shall not be
located in the vicinity of the service equipment, switchgear, or
industrial control assemblies. Protection shall be provided where
necessary to avoid damage from condensation leaks and breaks in such
foreign systems. Piping and other facilities shall not be considered
foreign if provided for fire protection of the electrical
installation.

The argument is in the interpretation of &quot;Service Equipment&quot; when it comes to residential panels. If the panel is a &quot;sub-panel&quot;, meaning NOT the first place where the utility feed lands, then some people say this rule does not apply. Other inspectors do not make the distinction.
Then, there is the term &quot;... in the vicinity of...&quot;, because it doesn't state a distance. In a previous portion of the same article, they call out for 3ft clearance as &quot;working space&quot;, but some inspectors interpret that to mean only IN FRONT OF the gear.
Then there is the phrase &quot;... or whose malfunction would endanger the operation ...&quot;. Is a 1/2&quot; water pipe likely to burst and spray on a load center?
My best advice is to as a local inspector, they are the final say-so.