API
September 24, 2021 ยท View on GitHub
Welcome to the mineflayer-pvp API documentation page.
Table of Contents
1. Summary
-
bot.pvp.attack(entity)Attacks the given entity
-
bot.pvp.targetThe entity currently being attacked, if any. Value is read-only!
-
bot.pvp.stop()Stops attacking the target entity.
-
bot.pvp.forceStop()Stops attacking the target entity. Forces pathfinder to stop.
-
bot.pvp.movementsThe pathfinder movements config to use when pursuing a target.
-
bot.pvp.followRangeHow close to try to get to the target.
-
bot.pvp.viewDistanceHow far away should a target be before losing interest.
-
bot.pvp.attackRangeHow far from the target can the bot be and still try to attack.
-
bot.pvp.meleeAttackRateThe solver for determining how often to attack the target.
-
bot.on('startedAttacking', () => {})Called when the bot has started attacking a new target.
-
bot.on('stoppedAttacking', () => {})Called when the bot has stopped attacking a target. (Either manualluy stopped, or target has died/teleported/despawned/disconnected.)
-
bot.on('attackedTarget', () => {})Called each time the bot preforms a melee attack.