mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-10 12:02:59 +02:00
added teleport to gotoposition
This commit is contained in:
parent
ca4ef4114a
commit
baa51ee2c8
1 changed files with 5 additions and 0 deletions
|
@ -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}.`);
|
||||
|
|
Loading…
Add table
Reference in a new issue