run

open fun run(command: String, allowUntrusted: Boolean): String

Send command as the player and collect chat-window feedback for CAPTURE_WINDOW_MS.

Return

the captured game output verbatim; lines we insert ourselves are prefixed [mcp] so a reader can tell them from real output. Returns null when there is no local player — so the caller can fall through to a precise not-ready error. Minecraft.getInstance() is non-null from mod init on, but half-built until its constructor returns — what makes that safe is that nothing here reads client state off the game thread, not Lanes.CLIENT.isReady, which is a physical-side constant.

Parameters

allowUntrusted

keep player-influenced lines rather than counting them as withheld.