aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-05-09 19:06:57 -0500
committermat <github@matdoes.dev>2022-05-09 19:06:57 -0500
commit307594723c354a4b988913bedf99b2c533ced720 (patch)
treed3e51a20c8aaf3576fe3d70a3e814f55911f8a06
parentd783a0295b11c32f1b5425cab2461f9297f7f8fa (diff)
downloadazalea-drasl-307594723c354a4b988913bedf99b2c533ced720.tar.xz
write how i want using the held item to work
-rwxr-xr-xREADME.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/README.md b/README.md
index 909ae47e..d0dea3da 100755
--- a/README.md
+++ b/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;
+ }
+ }
+ }
+ }
_ => {}
}
}