Examples
Step-by-step scripting workflow examples for SoulFire, from simple greetings to AI-powered chatbots.
These examples walk through common automation workflows you can build with SoulFire's scripting system. Each one describes the nodes you need, how to connect them, and what the result looks like.
Auto-greeter
Goal: Send a welcome message when your bot joins a server.
Nodes:
- On Join (trigger) - fires when the bot enters the world
- Send Chat (action) - sends a message in chat
Setup:
- Place an On Join trigger node
- Place a Send Chat action node
- Connect the exec output of On Join to the exec input of Send Chat
- Set the Send Chat message to something like
Hey everyone, I just joined! - Activate the script
When any bot joins the server, it will automatically send the greeting. The On Join trigger also outputs the bot's name, so you could use a Format string node to personalize the message.
Chat command bot
Goal: Respond to players who type !ping in chat with "Pong!".
Nodes:
- On Chat (trigger) - fires on every chat message
- Contains (string) - checks if the message contains "!ping"
- Branch (flow) - routes based on the result
- Send Chat (action) - sends the response
Setup:
- Place an On Chat trigger
- Place a Contains node. Connect the
messagePlainTextoutput from On Chat to thestringinput of Contains. Set the search term to!ping - Place a Branch node. Connect the
resultoutput from Contains to theconditioninput of Branch - Place a Send Chat node on the "true" output of Branch. Set the message to
Pong! - Connect the
botoutput from On Chat to thebotinput of Send Chat - Activate the script
Now whenever someone types !ping in chat, the bot responds with Pong!. You can extend this with multiple Branch/Contains checks for different commands.
AI chatbot
Goal: Use an LLM to generate responses to player messages.
Nodes:
- On Chat (trigger) - fires on chat messages
- Contains (string) - checks if the message mentions the bot
- Branch (flow) - only responds to relevant messages
- LLM Chat (AI) - generates a response using OpenAI
- Send Chat (action) - sends the AI's response
Setup:
- Place an On Chat trigger
- Place a Contains node to check if
messagePlainTextcontains your bot's name - Place a Branch node on the result
- On the "true" path, place an LLM Chat node:
- Set the system prompt to something like
You are a friendly Minecraft bot. Keep responses short (under 100 characters) and casual. - Connect
messagePlainTextfrom On Chat to theuserMessageinput - Make sure your OpenAI API key is configured in instance settings
- Set the system prompt to something like
- Place a Send Chat node. Connect the LLM Chat
responseoutput to the Send Chatmessageinput - Connect the
botfrom On Chat through to Send Chat - Activate the script
Configure your OpenAI API key in the instance settings before using the LLM Chat node. The node supports any OpenAI-compatible endpoint, so you can also use local models.
Auto-respawn with Discord notification
Goal: Automatically respawn after death and send a notification to Discord.
Nodes:
- On Death (trigger) - fires when the bot dies
- Wait (action) - brief delay before respawning
- Send Chat (action) - sends
/respawnor a death message - Discord Webhook (network) - posts to a Discord channel
Setup:
- Place an On Death trigger
- Place a Wait node with a 2000ms delay (gives the death screen time to appear)
- Connect the Wait output to a Send Chat node (or use a respawn action if available)
- In parallel, connect On Death to a Discord Webhook node:
- Set the webhook URL to your Discord channel's webhook
- Use a Format node to build the message, e.g.,
Bot died! Previous health: {previousHealth}
- Activate the script
The bot will respawn after 2 seconds and simultaneously notify your Discord channel about the death.
Patrol bot
Goal: Have a bot walk between waypoints on a loop.
Nodes:
- On Interval (trigger) - fires every N seconds
- Modulo (math) - cycles through waypoint indices
- Switch (flow) - routes to different Pathfind nodes
- Pathfind To (action) - moves to each waypoint
- Get Bots (data) - gets a bot to move
Setup:
- Place an On Interval trigger. Set the interval to 15000ms (15 seconds, enough time to walk between points)
- Place a Modulo node. Connect
executionCountto one input, set the other to3(number of waypoints) - Place a Switch node. Connect the Modulo result to its input
- For each case (0, 1, 2), place a Pathfind To node with different coordinates
- Use a Get Bots node and For Each Bot to apply this to all connected bots, or use a specific bot reference
- Activate the script
The bot will cycle through the three waypoints every 15 seconds, walking to each one in order.
Resource collector
Goal: Find and mine a specific block type nearby.
Nodes:
- On Bot Init (trigger) - starts when the bot connects
- Find Block (data) - locates the nearest target block
- Branch (flow) - checks if a block was found
- Pathfind To (action) - walks to the block
- Break Block (action) - mines the block
- Wait (action) - brief pause between attempts
Setup:
- Place an On Bot Init trigger
- Place a Find Block node. Set the block type to what you want to mine (e.g.,
diamond_ore) and a search radius (e.g., 32 blocks) - Place a Branch node. Connect the "found" boolean output to its condition
- On the "true" path:
- Place a Pathfind To node. Connect the block's x, y, z to the pathfinding target
- Place a Break Block node. Connect the same coordinates
- Place a Wait node (2000ms to let the block break)
- Loop back: connect the Wait node's exec output back to the Find Block node's exec input (this creates a loop)
- Activate the script
The bot will continuously search for the target block, walk to it, mine it, wait, and then search again.
Make sure your loop has a reasonable Wait duration to avoid overwhelming the server. The break block action takes real game time, so 2-3 seconds is usually enough.
Tips for building scripts
- Start small. Build one piece at a time and test as you go. Activate the script and watch the execution log to see if things work as expected.
- Use the execution log. It shows you exactly which nodes fired, what data they produced, and any errors that occurred.
- Save often. The editor tracks unsaved changes, but it's good practice to save after each working iteration.
- Group related nodes. Select multiple nodes and press Ctrl+G to group them. This keeps complex scripts organized.
- Mute nodes for testing. Press M on a selected node to mute it. Muted nodes are skipped during execution, which is useful for testing different parts of your script.
How is this guide?
Last updated on