grab

fun grab(): ByteArray?

Take a screenshot and encode it. Blocks until the image lands.

No timeout, matching execute_code on the same lane: the render thread has no terminal boundary short of JVM exit, so a wait that never ends means a game that has already stopped — and the HTTP pool's threads are daemons. A timeout would only misfire on the honest slow cases, where frames are seconds apart because the world is loading.

Return

the encoded image, or null if this runtime exposes no usable takeScreenshot or has no render target yet.