Takeover

4min read
Sheet 10 of 47 · Bots

Take over swaps a bot for a real Minecraft window, logged in as the same account, on the same server. It sits in the bot header, or on a right-click on a bot. Release closes the client and reconnects the bot at once.

A live connection cannot be handed over, so the tool disconnects the bot, starts vanilla Minecraft with --quickPlayMultiplayer, and brings the bot back when the window closes.

What happens on a takeover

TopicHow it works
Closing the clientThe bot comes back unless Settings turns that off
AccountsOffline bots get their offline UUID and a dummy token. Premium bots get a fresh Minecraft token from their account and keep the account while the client runs
Client filesThe jar, libraries, natives, assets and a matching Java runtime are downloaded once into client-cache, checked against their SHA1s, and reused. Settings can point at an existing .minecraft to copy files from instead
ProcessesThe client shows up on the Processes and Console pages and runs inside the job object

The takeover proxy

By default the client does not connect to the server itself. The tool opens a proxy on 127.0.0.1 with a random port, points the client at it, and connects to the server on its behalf.

TopicHow it works
ReadingBytes pass through untouched. The proxy decodes a copy of each packet and feeds it to the bot, which stays in the list as online. /win, /dialog, /log, /inv, /pos and the bot's packet log work during a takeover and return the same JSON as for a bot
SendingActions that send packets (/chat, /click, /close, dialogAction and the rest) are injected into the server connection. The client does not know about them, except /close, which also closes the client's screen. Raw packets (raw, /packet with hex) are refused while the proxy runs
VersionsThe client always runs 1.21.11. The proxy's server side goes through Via like a bot, so a takeover works on every version the bots support. The version is detected, or taken from the bot's version=
Online modeTowards the client the proxy is an offline-mode server, so the client needs no encryption. Towards the server the proxy logs in itself: it answers the encryption request, joins the Mojang session server with the account's token and turns on encryption. The client still gets the real token, so it signs chat and a server with enforce-secure-profile=true accepts it
One clientThe proxy lets one client log in at a time, and only under the bot's name. Status pings pass through

To connect the client straight to the server instead, tick "Connect the client straight to the server" in Settings (takeoverDirect). The client version is then the one the server reports or the one set in Settings, and the tool does not see the traffic.

Your own client

By default the takeover runs vanilla Minecraft from client-cache. To take over with a client you installed yourself, for example a Fabric profile with shaders, point takeoverLaunchJson (Settings > Taking over a bot > Modded client launch file) at a launch file:

{
  "main": "net.minecraft.client.main.Main",
  "natives": "D:/mc/natives",
  "classpath": "D:/mc/libraries/a.jar;D:/mc/versions/1.21.11/1.21.11.jar",
  "args": ["--username", "SkyFarmer4", "--version", "1.21.11", "--uuid", "5803341ae6843c89b3c2cf46e315bbe1",
           "--accessToken", "0", "--userType", "legacy"],
  "gameDir": "D:/mc"
}

main, natives, classpath and args are what your launcher would run; for a Fabric profile main is Fabric's loader class and the classpath holds its libraries. gameDir is optional.

  • The tool starts it with the Java of Settings > Test server (empty is the Java the tool runs on), -Xmx from the Game client memory, the bot's name with its offline UUID, --quickPlayMultiplayer to the takeover proxy and the Game client window size.
  • The values after --username and --uuid in args are swapped for the bot's. Leave --quickPlayMultiplayer out of args: one that is there is kept, and the client then skips the takeover proxy.
  • Nothing is downloaded for it. Behind the proxy the client has to run 1.21.11, the version the proxy speaks; the proxy bridges to the server's version and does the premium login for a premium bot.
  • The same client is what filming records, with an optional shader profile and camera mod.

Screenshots and recordings

While a client runs, the tool can grab its window. It finds the window by the client's process ID and uses PrintWindow with PW_RENDERFULLCONTENT, so the window can sit behind others. No keys or clicks go to any window.

WhereHow
WindowThe camera button in the bot header saves a PNG. The video button starts a recording and stops it on the next press. Files go to captures in the data dir
API/screenshot, /record/start and /record/stop
ScenariosSteps can do all of this themselves. See Screenshots in Scenarios

Recordings are animated GIFs, written frame by frame while they run, so memory stays flat. Each frame keeps its real delay, so a slow encode makes the GIF choppy, not fast. The GIF palette is 256 colors per frame.

A minimized client has no picture. Restore it first; a window behind other windows is fine.

Loading the index

Enter openUp Down moveEsc close