Skip to content

Client tools ​

Each MCP tool mc_* wraps one method of the mod's WebSocket API (the Method column), so scripts can call the same thing over the raw protocol. Coordinates in GUI tools are GUI-scaled, as mc_snapshot reports them. 20 ticks = 1 second.

Lifecycle and worlds ​

ToolMethodWhat it does
mc_statusstatusState (starting/loading/title/joining/in-world), ready, screen, MC + loader versions, mod list
mc_wait_ready(polls status)Wait until the client is up and accepting input; tolerates the game not running yet
mc_world_createworld.create {name,seed?,flat?,gamemode?,difficulty?,cheats?,…}New world, waits until in-world (creative + cheats by default)
mc_world_joinworld.join {name,confirmPrompts?}Open an existing world by folder id or display name. Answers the "experimental settings / backup" prompt (any world with datapack registry content gets it) unless confirmPrompts:false
mc_world_leaveworld.leaveSave and quit to title, or disconnect from a server
mc_world_listworld.listWorlds in the saves folder
mc_world_deleteworld.delete {name}Delete a world (not the open one)
mc_connectconnect {address?}Join a multiplayer server and wait until in-world; fails with the disconnect reason
mc_quitquitQuit the game cleanly (saves first), e.g. to restart after rebuilding your mod
mc_crash_report(reads files)Newest crash report or JVM hs_err log of the client or server, also after the game has died

Observing ​

ToolMethodWhat it does
mc_screenshotscreenshot {name?,maxSize?}Saves a full-size PNG to <gameDir>/mctest/screenshots/; returns the path and the image scaled to fit maxSize (default 1280) as JPEG, so large windows arrive intact
mc_window_resizewindow.resize {width,height}Resize the game window (leaves fullscreen); returns size and GUI scale
mc_snapshotsnapshotScreen class/title, widgets (index:Class:text id, type, text, x/y/w/h, active, focused, visible, values), container slots (menu index, item, count, components, x/y), carried stack
mc_playerplayerPosition, rotation, dimension, gamemode, health, food, xp, crosshair target, inventory, effects, attributes
mc_blockblock {x,y,z,source?}Block id, state properties, block-entity NBT (from the integrated server in singleplayer)
mc_entitiesentities {radius?,type?,limit?}Nearby entities with ids, types, names, health, item stacks
mc_scan_blocksscanBlocks {radius?, blocks?}Block types around you with counts and nearest positions (ids or #tags)
mc_tooltiptooltip {slot,advanced?,modifiers?}Tooltip lines of an item (menu slot if a container is open, else inventory slot); modifiers: ["shift"] for hold-shift/ctrl tooltips
mc_logslogs {since?,level?,contains?,limit?}Captured log lines with exception stacks, paged by sequence number
mc_keybindskeybindsList all key mappings

GUI input ​

ToolMethodWhat it does
mc_clickclick {x,y,button?,modifiers?}Click at GUI coordinates through the real mouse handler
mc_click_widgetclickWidget {id}Click a widget's centre. Old ids still work if Class:text is unique
mc_click_slotclickSlot {index,button?,clickType?}Container click by menu slot index (PICKUP, QUICK_MOVE, SWAP, CLONE, THROW, QUICK_CRAFT, PICKUP_ALL)
mc_hoverhover {slot | x,y}Move the mouse without clicking (slot tooltips in screenshots)
mc_keykey {key,modifiers?,action?}Keyboard key through the real handler (e, escape, enter, f3, left_shift, …); press holds it (seen by hasShiftDown()) until release
mc_typetype {text}Type into the focused text field
mc_scrollscroll {amount,x?,y?}Mouse wheel (lists, or hotbar in-world)
mc_close_screencloseScreenClose the current screen

Gameplay ​

ToolMethodWhat it does
mc_commandcommand {command,ticks?}Run a command, return the chat output from the next few ticks
mc_chatchat {message}Send a chat message
mc_teleportteleport {x,y,z,yaw?,pitch?}/tp and wait until arrived
mc_look_at / mc_looklookAt {x,y,z} / look {yaw,pitch}Aim the player
mc_keybindkeybind {name,action,ticks?}Drive any key mapping (including other mods' keybinds): tap/press/release/hold. Walking = hold forward
mc_select_slotselectSlot {slot}Select hotbar slot 0–8
mc_select_itemselectItem {item}Hold an item (swaps it into the hotbar if needed)
mc_use_onuseOn {x,y,z,face?,hand?}Right-click a block face: place blocks, open GUIs, use tools
mc_use_itemuseItem {hand?,ticks?}Right-click the held item; ticks keeps using it (eat, drink, draw a bow)
mc_break_blockbreakBlock {x,y,z,face?,timeoutTicks?}Mine with real dig time (instant in creative)
mc_attack_entityattackEntity {id}Attack an entity
mc_interact_entityinteractEntity {id,hand?}Right-click an entity (trade, milk, ride, mod entities)
mc_reload_resourcesreloadResourcesReload resource packs (F3+T) after editing assets

Player skills ​

ToolMethodWhat it does
mc_gotogoto {x,y,z | entity, range?, sprint?}Walk there like a player: A* pathfinding, gradual turning, sprinting, jumping, drops, swimming, replanning
mc_collectcollect {block, count, radius?}Walk to visible matching blocks, use the best tool, mine with real dig time, pick up the drops; counts only what reached the inventory
mc_digdig {mode, length, direction?, until?}Staircase down (stairs), staircase up (up), or 1×2 tunnel; stops at lava/water, your own blocks, or the until block
mc_placeplace {item, x?,y?,z?}Place a block against any solid face; picks a sensible nearby spot if no position is given
mc_fightfight {id | type, fleeHealth?}Equip a weapon, close in, aim, attack only at full cooldown
mc_craftcraft {item, times?}Recipe-book crafting: 2×2 in the inventory, 3×3 by walking to and opening a nearby crafting table

Time ​

ToolMethodWhat it does
mc_time_freeze / mc_time_unfreezetime.freeze / time.unfreezeFreeze the world (like /tick freeze, no cheats needed); the player can still act
mc_time_steptime.step {ticks}Advance a frozen world by exactly N ticks
mc_locksteptime.lockstep {enabled}The world only runs while an MCTest action is in progress, so nothing happens while the agent is thinking
mc_time_statustime.statusFrozen / lockstep state and game time

Waiting ​

ToolMethodWhat it does
mc_wait_forwaitFor {condition,timeoutTicks?}screen:<Class>/screen:none, slot:<i>=<item|empty>, block:<x,y,z>=<id>, ticks:<n>, state:<state>, log:<text>, chat:<text>, entity:<type>[@radius]

GameTests ​

ToolMethodWhat it does
mc_gametest_listgametest.list {filter?}GameTests registered in the singleplayer world (vanilla, your mod's, datapack test instances)
mc_gametest_rungametest.run {tests?,timeoutSeconds?}Run GameTests (/test run <selector>) and wait: pass/fail per test with the failure message and position, plus an overall success

Anything else ​

ToolMethodWhat it does
mc_callanyEscape hatch: call a method by name with raw params

Released under the MIT License.