1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//! ghast: a headless Minecraft Java Edition client / bot library.
//!
//! This facade re-exports the bot API of [`ghast-client`](ghast_client) at the top level and
//! the lower layers as modules:
//!
//! | module | crate | what |
//! |---|---|---|
//! | (root) | `ghast-client` | [`Client`], [`Behavior`], [`TickContext`], the tick loop |
//! | [`protocol`] | `ghast-protocol` | packets per version, framing, compression, encryption, NBT |
//! | [`auth`] | `ghast-auth` | offline identities, SOCKS5, login crypto, Microsoft accounts |
//! | [`data`] | `ghast-data` | blocks, collision shapes, items, entities |
//! | `ext` (feature `ext`) | `ghast-ext` | sequential async helpers: look, dig, place, equip, containers, chat, events |
//! | `pathfinder` (feature `pathfinder`) | `ghast-pathfinder` | physics-validated A* path planning and following |
//! | `viewer` (feature `viewer`) | `ghast-viewer` | bot screen: live 3D view in the browser, recordings, replays |
//!
//! Supported versions: 1.8.9, 1.12.2, 1.16.5, 26.1, 26.2 and 26.3. See the `afk` and `chat` examples:
//!
//! ```text
//! cargo run -p ghast --example afk -- --host localhost --port 25565 --username Bot --version 1.8.9
//! ```
//!
//! ## Features
//!
//! Every supported Minecraft version is a cargo feature (`v1_8`, `v1_12_2`, `v1_16_5`, `v26_1`,
//! `v26_2`, `v26_3`), all on by default; drop the ones you never connect with to cut compile
//! time and binary size. The version is picked at run time with [`GameVersion`]
//! (`#[non_exhaustive]`: new versions arrive in patch releases). Optional features, off by
//! default:
//!
//! - `microsoft`: online-mode servers (Microsoft account login, session-server join; pulls in an
//! HTTPS client).
//! - `ext`: `ghast::ext`, sequential async helpers.
//! - `pathfinder`: `ghast::pathfinder`; with `ext` also `Bot::goto` / `Bot::follow_path`.
//! - `viewer`: `ghast::viewer`, the bot screen in the browser.
//!
//! ## Many bots
//!
//! One bot: a `current_thread` tokio runtime. Many bots in one process: [`Swarm`] (worker
//! threads with one current-thread runtime each; bots are placed on the least-loaded one).
pub use *;
/// The network protocol (`ghast-protocol`).
pub use ghast_protocol as protocol;
/// Connection setup and authentication (`ghast-auth`).
pub use ghast_auth as auth;
/// Static game data (`ghast-data`).
pub use ghast_data as data;
/// Sequential async helpers on the tick model (`ghast-ext`, feature `ext`). With the
/// `pathfinder` feature too, `Bot::goto` walks planned paths.
pub use ghast_ext as ext;
/// Physics-validated path planning and following (`ghast-pathfinder`, feature `pathfinder`).
pub use ghast_pathfinder as pathfinder;
/// The bot screen: a live 3D view of the bot's world in the browser, with recordings and
/// replays (`ghast-viewer`, feature `viewer`). Textures come from Mojang's client jar, fetched
/// at run time.
pub use ghast_viewer as viewer;