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

Bot won't take knockback on hypixel #2122

Closed chickenPizza closed 3 years ago

chickenPizza commented 3 years ago

Versions

Detailed description of a problem

Is there any way to make the bot take knockback on hypixel?

What did you try yet?

Ive tried using this but it wont work:

bot._client.on('entity_velocity', v => { if (bot.entity.id !== v.entityId) return

bot.entity.velocity.x += v.velocityX
bot.entity.velocity.y += v.velocityY
bot.entity.velocity.z += v.velocityZ

})

nickelpro commented 3 years ago

Related possibly? https://github.com/PrismarineJS/mineflayer/pull/2043

chickenPizza commented 3 years ago

Solved with:

bot._client.on('explosion', explosion => { if (bot.physicsEnabled && bot.game.gameMode !== 'creative') { bot.entity.velocity.x += explosion.playerMotionX bot.entity.velocity.y += explosion.playerMotionY bot.entity.velocity.z += explosion.playerMotionZ } })

u9g commented 3 years ago

fixed in 3.10.0, if you update you dont need those lines