Screenshots in Scenarios
Filescenarios/hub-pictures.ymlA scenario can hand its bot to a real client, park the camera and save pictures of what a player sees. The client itself is covered on Takeover.
A full example
bot: Cam
steps:
- do: join
- do: takeover # real client in place of the bot, waits until it is in the world
timeout: 120000 # default, counted after the client download
settle: 2000 # extra wait for chunks to render, default 2000
- do: frame # minecraft:tp Cam x y z yaw pitch through rcon, or the agent's /exec without rcon
x: 0.5
y: 80
z: 12.5
yaw: 180
pitch: 15
world: world_nether # optional, runs execute in <world> run tp ...
settle: 500 # default
- do: key
key: F5 # F1-F12, A-Z, 0-9 (hotbar), ESC, TAB, SPACE, ENTER, chords like F3+D clear the chat
- do: chat
c: /hub
- do: screenshot
name: hub-menu # file name, -2, -3 when taken
hideHud: true # F1 before the shot, F1 again after
delay: 300 # ms before the shot
scale: 0.5 # default 1
- do: record
action: start
name: parkour
fps: 10 # defaults: fps 10, scale 0.5, max 60 s
- do: action
action: walk
forward: 3
- do: record
action: stop
- do: release # client closes, the bot comes back, the scenario waits for itThe steps
| Step | Parameters | What it does |
|---|---|---|
takeover | timeout (default 120000, counted after the client download), settle (default 2000) | Puts a real client in place of the bot and waits until it is in the world. settle is an extra wait for chunks to render |
frame | x, y, z, yaw, pitch, world (optional), settle (default 500) | Runs minecraft:tp for the bot through rcon, or the agent's /exec without rcon. With world it runs execute in <world> run tp ... |
key | key | Posts key presses to the client window: F1-F12, A-Z, 0-9 (hotbar), ESC, TAB, SPACE, ENTER, and chords like F3+D |
screenshot | name, hideHud, delay, scale (default 1) | Saves a picture. A second and third shot with the same name get -2, -3. delay is ms before the shot |
record | action: start with name, fps, scale, max, or action: stop | Records a clip. Defaults: fps 10, scale 0.5, max 60 s (up to 300) |
release | Closes the client and brings the bot back. The scenario waits for it |
Keys
key sends a chord down in order and up in reverse. F5 cycles the camera to third person, F3+D clears the chat, ESC closes a screen. Nothing reads back whether the client took it.
hideHud is the same: it posts F1 to the client window before the shot and again after. A client with a screen open, or one that ate the key, shows the hud anyway. When the key cannot be sent at all the shot is taken with the hud and the message says so.
Where the files go
- Files go to
captures/run-<time>/in the data dir,captures/suite-<time>/<file>/for suite runs and--capturesin CI. The step message names the file. - Every capture lands in the scenario report under
captures(name,file,stepPath,bot,kind), so/scenario/run,/suite/runand the HTML report show them. - The Captures tab on the Scenarios page shows thumbnails of the last run. A click opens the file.