|
|
|
@ -37,7 +37,7 @@ function moveNear(pos, distance = 3) { |
|
|
|
|
bot.pathfinder.setGoal(new GoalNear(pos.x, pos.y, pos.z, distance)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function follow(entity, dynamic = true) { |
|
|
|
|
function follow(entity, dynamic = true, distance = 3) { |
|
|
|
|
console.assert(entity) |
|
|
|
|
const { GoalFollow } = require('mineflayer-pathfinder').goals |
|
|
|
|
|
|
|
|
@ -53,7 +53,7 @@ function follow(entity, dynamic = true) { |
|
|
|
|
// console.log(entity)
|
|
|
|
|
|
|
|
|
|
bot.pathfinder.setMovements(movements.defaultMove) |
|
|
|
|
bot.pathfinder.setGoal(new GoalFollow(entity, 3), dynamic) |
|
|
|
|
bot.pathfinder.setGoal(new GoalFollow(entity, distance), dynamic) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function hit(blockOrEntity) { |
|
|
|
|