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:
parent
d783a0295b
commit
307594723c
1 changed files with 18 additions and 0 deletions
18
README.md
18
README.md
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue