I added the fishtank schematic to the doc dir. Created using worldedit.
Found the main problem seems to be the fish dies before it has a chance
to react to being out of water. Moving the health check until after the
timer check seems to fix this. Fish now have time to fall because
they're in water, but they don't move away from it on their own.
I duplicated and modified the swim from player function to swim from a
pos. Seems to work, but notice it gets a little confused. Think this
reflects my confusion on how yaw works so you may see an obvious fix to
what I'm doing. It should be trying to do 180 from current direction,
until it gets far enough away from the original position that there is
more then .5 distance. I added this because initially there is little
or no distance between them and it seemed to get confused about where to
go. Was thining adding some randomness to the direction might help bt
haven't tested that yet.
I left all the print statements in so you can see what I was testing.
Found doing a /clearobjects then placing one fish in the tank at a time
works best.
I added the fishtank schematic to the doc dir. Created using worldedit. Found the main problem seems to be the fish dies before it has a chance to react to being out of water. Moving the health check until after the timer check seems to fix this. Fish now have time to fall because they're in water, but they don't move away from it on their own.
I duplicated and modified the swim from player function to swim from a pos. Seems to work, but notice it gets a little confused. Think this reflects my confusion on how yaw works so you may see an obvious fix to what I'm doing. It should be trying to do 180 from current direction, until it gets far enough away from the original position that there is more then .5 distance. I added this because initially there is little or no distance between them and it seemed to get confused about where to go. Was thining adding some randomness to the direction might help bt haven't tested that yet.
I left all the print statements in so you can see what I was testing. Found doing a /clearobjects then placing one fish in the tank at a time works best.