added teleport to gotoposition

This commit is contained in:
MaxRobinsonTheGreat 2024-06-03 18:33:00 -05:00
parent ca4ef4114a
commit baa51ee2c8

View file

@ -713,6 +713,11 @@ export async function goToPosition(bot, x, y, z, min_distance=2) {
log(bot, `Missing coordinates, given x:${x} y:${y} z:${z}`);
return false;
}
if (bot.modes.isOn('cheat')) {
bot.chat('/tp @s ' + x + ' ' + y + ' ' + z);
log(bot, `Teleported to ${x}, ${y}, ${z}.`);
return true;
}
bot.pathfinder.setMovements(new pf.Movements(bot));
await bot.pathfinder.goto(new pf.goals.GoalNear(x, y, z, min_distance));
log(bot, `You have reached at ${x}, ${y}, ${z}.`);