Triggers
Learn when each SoulFire scripting trigger runs and what data it provides.
Triggers start SoulFire scripts. When a trigger fires, SoulFire runs the connected execution path.
Before you pick a trigger
Keep these engine details in mind:
- A script can contain multiple triggers.
- Each trigger can fire many times.
- Trigger runs are limited by script quotas. The current default is 1 concurrent run per script.
- Event triggers use a buffer. Under heavy load, SoulFire can discard extra events when the buffer is full.
On Pre Entity TickandOn Post Entity Tickrun on the tick thread. Expensive nodes can delay the game loop.On Intervaldoes not output a bot. If you need to act on bots, useGet BotsandFor Each Bot.
Bot connection triggers
On Bot Init
Fires when the bot connection starts, before the player object is ready.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot being initialized |
serverAddress | String | The current server address |
username | String | The bot account name |
Use this when you need early connection setup. If you want to move, chat, or interact with the world, use On Join instead.
On Join
Fires when the bot has fully joined and is ready to interact.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot that joined |
serverAddress | String | The current server address |
username | String | The bot account name |
This is the best default startup trigger for most scripts.
On Disconnect
Fires when a bot disconnects.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The disconnected bot |
reason | String | The disconnect message |
Use this for cleanup, logging, or reconnect-related workflows.
Gameplay event triggers
On Chat
Fires when a bot receives a chat message.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot that received the message |
message | Any | The received message payload |
messagePlainText | String | The plain-text version of the message |
timestamp | Number | When the message arrived |
Use this for chat commands, alerts, filters, and chatbot flows.
On Damage
Fires when a bot's health decreases.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot that took damage |
amount | Number | Damage dealt |
previousHealth | Number | Health before damage |
newHealth | Number | Health after damage |
This is a good trigger for escape logic, healing logic, and combat alerts.
On Death
Fires when the bot dies.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The dead bot |
shouldRespawn | Boolean | Current respawn intent from the event |
Use this with Respawn, Discord notifications, or post-death recovery logic.
On Container Open
Fires when the bot opens a container or inventory-like screen.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot that opened the container |
containerId | Number | Internal container ID |
containerName | String | Display name of the opened container |
containerType | String | Container type |
Use this for chest workflows, menu automation, and shop interactions.
Timer and script lifecycle triggers
On Interval
Fires on a repeating timer.
| Input | Type | Default | Meaning |
|---|---|---|---|
intervalMs | Number | 1000 | Delay between runs in milliseconds |
| Output | Type | Meaning |
|---|---|---|
executionCount | Number | How many times this trigger has fired |
On Interval is instance-level, not bot-level. If you want to run something for every connected bot, connect On Interval to Get Bots and then For Each Bot.
On Script Init
Fires once when the script starts.
| Output | Type | Meaning |
|---|---|---|
timestamp | Number | Start time in milliseconds |
Use it for setup, startup logs, and shared data.
On Script End
Fires once when the script is stopping.
| Output | Type | Meaning |
|---|---|---|
timestamp | Number | Stop time in milliseconds |
On Script End runs during shutdown.
SoulFire waits up to 5 seconds for this trigger, so keep cleanup work short.
Tick triggers
On Pre Entity Tick
Fires before entity movement in each tick. It runs directly on the tick thread.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot for this tick |
tickCount | Number | Tick counter for this trigger |
Use this for aiming, rotation changes, or other logic that must happen before the tick updates movement.
On Post Entity Tick
Fires after entity movement in each tick. It runs directly on the tick thread.
| Output | Type | Meaning |
|---|---|---|
bot | Bot | The bot for this tick |
tickCount | Number | Tick counter for this trigger |
Use this for logic that needs the world state after movement. For example, use it for a combat action after movement.
Tick triggers are low-level tools. Avoid HTTP requests, LLM calls, long waits, or wide loops in these paths.
Choose a trigger
- Use
On Joinfor most startup behavior. - Use
On Bot Initonly whenOn Joinis too late. - Use
On Chatfor anything message-driven. - Use
On Intervalfor a task that runs at a fixed interval. - Use
On Pre Entity TickandOn Post Entity Tickonly for timing-sensitive logic. - Use
On Script InitandOn Script Endfor whole-script setup and cleanup.
Common mistakes
- Using
On Intervaland expecting abotoutput. - Treating
On Pre Entity Tickas a safe place for expensive work. - Using
On Bot Initfor actions that need a loaded player. - Putting all behavior in one large chain. One script can use several triggers.
How is this page?
Last updated on
