1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

write how i want using the held item to work

This commit is contained in:
mat 2022-05-09 19:06:57 -05:00
parent d783a0295b
commit 307594723c

View file

@ -38,6 +38,24 @@ loop {
println!(m);
bot.reconnect().await.unwrap();
},
Event::Hunger(h) {
if !h.using_held_item() && h.hunger <= 17 {
match bot.hold_item(azalea::ItemGroup::Food).await {
Ok(_) => {},
Err(e) => {
println!("{}", e);
break;
}
}
match bot.use_held_item().await {
Ok(_) => {},
Err(e) => {
println!("{}", e);
break;
}
}
}
}
_ => {}
}
}