-
-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
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
Bot can't detect mobs #3183
Comments
Callbacks are not supported, so the attack function wont work. As for the bot not detecting mobs at all, try |
Tell chatgpt to use promises instead of callbacks
…On Sun, Sep 10, 2023, 21:44 WhoTho ***@***.***> wrote:
Callbacks are not supported, so the attack function wont work.
As for the bot not detecting mobs at all, try e.name instead of e.mobType
—
Reply to this email directly, view it on GitHub
<#3183 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437VRAO2SY7THPMEH5UDXZYDAXANCNFSM6AAAAAA4IHVRTE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
this example is a copy of https://www.youtube.com/watch?v=walbRk20KYU. Thanks to Dude from CI, but still not working, i tried to remove "e.mobType" but still not working. i also tried that:
|
alr, nvm, i found a way to fix it. Thanks everyone for the support, specially me being lil dumbie :p here is the fixed code: const mineflayer = require('mineflayer')
const bot = mineflayer.createBot({
host: 'localhost',
port: 55879,
username: "MyBot",
verison: 1.19
})
bot.once('spawn', () => {
setInterval(() => {
const mob = bot.nearestEntity(entity => entity.name.toLowerCase() === 'zombie')
if (!mob) {
console.log("Nenhum mob identificado")
return
}
const pos = mob.position.offset(0, mob.height, 0)
bot.lookAt(pos)
bot.attack(mob)
}, 1000);
}); |
Versions
My code
Ye, that's it, it just doesn't detect, i already tried Chat GPT and a lot of stuff but it just doesn't works
The text was updated successfully, but these errors were encountered: