Your if enHero
block always returns, regardless which part if it executes. Returning from a function skips the rest, which means everything below that if-statement is unreachable. The result is enFire
, enWater
, and enEarth
are always 1
.
can you command collectors to move to the place I want them to go?
As goutham123 said, you can assign a function to hero.chooseItem
that returns a position. The collector the function was run for will seek out the fruit nearest to that position.