I want to program that I can enter coordinates in the Minecraft chat and the bot will go to them. But I don't know how to program something like that? Can anyone help?
I am new to this field and would like to test something simple, but I just can't do it.
This is the code I try to use but it wont work:
var mineflayer = require('mineflayer')
const { pathfinder, Movements, GoalBlock } = require('mineflayer-pathfinder')
const pathfinder = require('mineflayer-pathfinder').pathfinder
const Movements = require('mineflayer-pathfinder').Movements
const { GoalNear } = require('mineflayer-pathfinder').goals
const inventoryViewer = require('mineflayer-web-inventory')
var bot = mineflayer.createBot({
host: "localhost",
username: "MLGPlayer9",
version: "1.18.1"
})
inventoryViewer(bot)
bot.loadPlugin(pathfinder)
function greeting() {
bot.chat("Mooooooin");
}
bot.once("spawn", greeting);
function goto() {
bot.pathfinder.goto(1, 1, 1);
}
bot.once("spawn", goto);
bot.pathfinder.setGoal(new GoalNear(1, 1, 1, 1)) The last one is for how close