SDK recipes
Complete programs for common Minecraft bot jobs.
Each recipe is a complete program that shows the same job in TypeScript and Python.
Before you start
Complete the SDK installation and one first program. Unlike the first program, the recipes attach to a saved bot on a SoulFire server that is already running. They do not install a SoulFire server for you.
Set these values in the terminal that runs the recipe:
export SOULFIRE_URL="http://127.0.0.1:38765"
export SOULFIRE_TOKEN="your-api-token"
export SOULFIRE_INSTANCE_ID="your-instance-uuid"
export SOULFIRE_BOT_ID="your-bot-uuid"SOULFIRE_URLis the SoulFire API address, not the Minecraft server address.SOULFIRE_TOKENis an API token. Connect to an existing SoulFire server shows how to create one.SOULFIRE_INSTANCE_IDandSOULFIRE_BOT_IDidentify the saved bot. Find instance and bot IDs prints them.
Pick a job
- Reply to chat when a player sends a message.
- Collect blocks and wait for the durable task to finish.
- Follow the entity under the cursor with a connection safe reference.
- Move items through a container and close the menu safely.
Run and stop a recipe
Save the code using the filename in its code block.
Run a TypeScript file with bun run <filename.ts>.
Run a Python file with your virtual environment's Python, such as .venv/bin/python <filename.py>.
Some recipes run until you press Ctrl+C. Others finish when their action or task completes.
When a recipe calls bot.connect(), it stops the bot on exit only if the recipe started it.
The follow recipe uses the lower-level start API, so its task keeps running after the program exits.
Cancel that task and stop the bot yourself when you are done.
See bot state and task ownership.
Last updated on
Was this page helpful?
