This plugin is the task manager that executes tasks one by one, currently it supports very limited tasks,
but in near future it will support more. For better example on how to use this plugin, checkout
aether-core
.
- Support Discord Plugin (WIP)
- Integrate with Anti-AFK Plugin
- Support multiple tasks like interaction, etc.
- Support for task that can send custom event, insert components.
Firstly, add this to your dependencies i.e. inside Cargo.toml
azalea-task-manager = { git = "https://github.com/as1100k/aether" }
use std::time::Duration;
use azalea::prelude::*;
use azalea::BlockPos;
use azalea_task_manager::TaskManagerPlugin;
use azalea_task_manager::client::TaskManagerExt;
use azalea_task_manager::task_manager_queue::Task;
use azalea_task_manager::AddTaskEvent;
#[tokio::main]
async fn main() {
let account = Account::offline("_aether");
ClientBuilder::new()
.set_handler(handle)
.add_plugins(TaskManagerPlugin)
.start(account, "10.9.12.3")
.await
.unwrap();
}
#[derive(Component, Clone, Default)]
struct State;
async fn handle(client: Client, event: Event, state: State) -> anyhow::Result<()> {
match event {
Event::Login => {
let blockpos = BlockPos::new(0, 0, 0);
let blockpos_new = BlockPos::new(100, 0, 50);
let _ = client
.new_task(Task::GotoTask(blockpos, false, 2.0))
.new_task(Task::Delay(Duration::from_secs(2)))
.new_task(Task::GotoTask(blockpos_new, false, 2.0));
// Or send event
client.ecs.lock().send_event(AddTaskEvent {
entity: client.entity,
task: Task::Delay(Duration::from_secs(2))
});
}
_ => {}
}
Ok(())
}
For Latest information see task_manager_queue.rs
.
GotoTask(target, allow_mining, distance)
InteractWithBlock(target)
SendChatMessage(message)
Delay(Duration)
SetAntiAFK(enabled)
-> Only with feature:anti-afk