I tried this code
async function useEnderPearl() {
// Check if the bot has an ender pearl
const enderPearl = bot.inventory
.items()
.find((item) => item.name === "ender_pearl");
if (enderPearl) {
// Equip and use the ender pearl
bot.equip(enderPearl, "hand", () => {
bot.activateItem();
bot.lookAt(bot.position.add(bot.direction));
setTimeout(() => {
bot.activateItem();
}, 500);
});
}
}
useEnderPearl();
The bot picks the pearl in hand but it does not use it
I tried this code async function useEnderPearl() { // Check if the bot has an ender pearl const enderPearl = bot.inventory .items() .find((item) => item.name === "ender_pearl");
} useEnderPearl(); The bot picks the pearl in hand but it does not use it