We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EXISTING CODE: const mineflayer ... ... bot.loadPlugin(pathfinder)
bot.once('spawn', () => { // THIS OPEN BRACKET REQUIRES APPROPRIATE CLOSING BRACKET ................................... .................................. .............bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1)) } }) // MISSING CLOSING BRACKETS
UPDATED CODE:
const mineflayer ... ... bot.loadPlugin(pathfinder)
bot.once('spawn', () => { ................................... .................................. .............bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1)) } }) }) // ADDED CLOSING BRACKETS
ACTUAL UPDATED CODE:
const mineflayer = require('mineflayer') const pathfinder = require('mineflayer-pathfinder').pathfinder const Movements = require('mineflayer-pathfinder').Movements const { GoalNear } = require('mineflayer-pathfinder').goals const bot = mineflayer.createBot({ username: 'Player' }) bot.loadPlugin(pathfinder) bot.once('spawn', () => { const mcData = require('minecraft-data')(bot.version) const defaultMove = new Movements(bot, mcData) bot.on('chat', function (username, message) { if (username === bot.username) return const target = bot.players[username] ? bot.players[username].entity : null if (message === 'come') { if (!target) { bot.chat('I don\'t see you !') return } const p = target.position bot.pathfinder.setMovements(defaultMove) bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1)) } }) })
The text was updated successfully, but these errors were encountered:
#146 Solved unexpected end of input error in example code in README.txt. Thanks for merging my pull request.
Sorry, something went wrong.
No branches or pull requests
EXISTING CODE:
const mineflayer ...
... bot.loadPlugin(pathfinder)
bot.once('spawn', () => { // THIS OPEN BRACKET REQUIRES APPROPRIATE CLOSING BRACKET
...................................
..................................
.............bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1))
}
})
// MISSING CLOSING BRACKETS
UPDATED CODE:
const mineflayer ...
... bot.loadPlugin(pathfinder)
bot.once('spawn', () => {
...................................
..................................
.............bot.pathfinder.setGoal(new GoalNear(p.x, p.y, p.z, 1))
}
})
}) // ADDED CLOSING BRACKETS
ACTUAL UPDATED CODE:
The text was updated successfully, but these errors were encountered: