Echo wrote:two things:
1. Use the correct node-name: "default:water_source" not "default:water"
2. you can shorten your function:
Thanks Echo and Temperest! It works, It was water_source. But I might need to keep my code the way it was because I don't want to look for a whole square. I want to search as far out as possible in a small straight line in all four directions because that requires the searching of the least number of nodes. I'm hoping that will make my code more efficient, but you only have 1 search and I have 4, so that might make yours more efficient. I could change my code to 2 searches, 1 for each line. Hard to know which chews fewer cycles.
Your code searches
************
************
************
*****P******
************
************
************
Mine searches
*
*
*
*****P******
*
*
*