ghast-viewer
A bot screen for bots built on ghast: a live 3D view of the bot's world in the browser (first person, third person or a free camera), plus recordings, a dash cam and replays on the same page.
- Read-only. The viewer wraps your behaviour and reads the bot in
after_tick; it never writes to the game connection. The page can only send clock pings, flow-control ACKs and playback controls. - Free while nobody watches. No frames are built and no columns copied until a page is open; the server stops itself after an idle timeout.
- One per bot. Each bot serves its own page on its own port, on
127.0.0.1by default, optionally protected by a token. - No game assets in the crate. Textures and block models are built at run time from the
vanilla client jar, downloaded from Mojang's servers into a local
.cache/ghast-viewer(featuredownload, on by default), or read from a local copy (ViewerConfig::client_jar). - Only 1.8.9 sessions are drawn for now.
Use
Through the facade crate:
or on its own: cargo add ghast-viewer.
use ;
use ;
let viewer = new;
let addr = viewer.start.await?;
println!;
let client = new
.world_config;
let mut behaviour = viewer.watch;
client.run.await?;
The integration guide (INTEGRATION.md) covers ports, tokens, recordings, the dash cam and costs. The wire protocol between server and page is in docs/protocol.md.
Examples
Web client
The page (TypeScript, WebGL2) lives in web/; its built files in web/dist/ are committed and
embedded in the crate, so cargo build needs no Node. See web/README.md to
rebuild or test it.
Licence
MIT OR Apache-2.0.