PrismarineJS/mineflayer-pvp

The issue has been closed
target.stop() at attack function causing unexpected behaviour. #27
euseanwoon2016 posted onGitHub
I suggest the removal of this line.
I have found that calling stop()
here will make the bot receive a stoppedAttacking
event even though they have just started attacking. At the end of the attack, stop()
will be called again. This is, in my opinion, not really intuitive, since it will clash with the startedAttacking
event especially if the callback is async.
After removing this line, I found that the events emitted makes more sense than how it is now.
I understand that this may be used to show that the bot has changed targets but putting it in one general event of stoppedAttacking
is not intuitive.