remove lagency control.js
This commit is contained in:
parent
7d9b214120
commit
327d6e9328
21
control.js
21
control.js
@ -1,21 +0,0 @@
|
|||||||
const mineflayer = require('mineflayer');
|
|
||||||
const { pathfinder, Movements } = require('mineflayer-pathfinder');
|
|
||||||
const { GoalNear } = require('mineflayer-pathfinder').goals
|
|
||||||
|
|
||||||
function gotoOwner(bot, context) {
|
|
||||||
let owner = context.owner();
|
|
||||||
if (!owner) {
|
|
||||||
console.log('Owner is not configured or is offline');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!owner.entity) {
|
|
||||||
console.log('Owner is out of sight');
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let pos = owner.entity.position;
|
|
||||||
bot.pathfinder.setMovements(context.peaceful_tactic);
|
|
||||||
bot.pathfinder.setGoal(new GoalNear(pos.x, pos.y, pos.z, 1))
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = { gotoOwner };
|
|
Loading…
x
Reference in New Issue
Block a user