PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.92k stars 904 forks source link

Hello i am searching for code that can make mineflayer bot teleport to the village all playrs with command locate #2663

Closed Wayzle closed 1 year ago

Wayzle commented 2 years ago

Versions

Detailed description of a problem

A clear and concise description of what the problem is, with as much context as possible. What are you building? What problem are you trying to solve?

What did you try yet?

Did you try any method from the API? Did you try any example? Any error from those?

Your current code

const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({ host: 'UnsafeTest.aternos.me', // optional username: 'Dimas_notgames', // E-mail и пароль используются для version: '1.18.2' // При установленном значении false версия будет выбрана автоматически, используйте пример выше чтобы выбрать нужную версию })

bot.on('chat', function (username, message) { if (message == 'Start plugin'){ PS() }

})

function PS(){ bot.chat('/advancement grant Dimas_notgames everything') bot.chat('/gamemode survival @a') bot.chat('/gamemode spectator Dimas_notgames') bot.chat('/locate #minecraft:village') bot.on('locate', (teleport)) //bot.chat('/tp @a ' + location) }

// Прослушивание ошибок и причин отключения от сервера: bot.on('kicked', (reason, loggedIn) => console.log(reason, loggedIn)) bot.on('error', err => console.log(err))



## Expected behavior
A clear and concise description of what you expected to happen.

## Additional context
Add any other context about the problem here.
amoraschi commented 2 years ago

What's the issue here?