Send chat when a bot joins
Build, verify, and stop a two-node script in your tutorial project.
Ten poradnik jest dostępny tylko po angielsku.
Before you start
Complete Connect your first bot.
Keep DocsBot_1 stopped in Docs tutorial.
Keep the Minecraft console or a normal player open to observe chat.
Use a SoulFire server with the node types listed in the node reference.
Create the graph
- Open Scripts in the tutorial project.
- Create a script named
Tutorial greeting. - Add an On player ready trigger. Releases up to 2.10.7 call it On Join.
- Add a Send Chat action.
- Connect On player ready: Out to Send Chat: In with an execution wire.
- Set Send Chat: Message to
Hello from the visual script. - Save the script and enable it by clearing its paused state.
The graph is:
The join trigger supplies the bot in execution context. The Send Chat bot input is an optional override, so this graph needs no separate bot wire.
Alternatively, download the same graph and import it with the editor toolbar. Review the graph and save it after import. The download starts paused.
Run and verify
Start DocsBot_1 from Overview.
Expect one Hello from the visual script message after the bot joins.
A reconnect fires the join trigger again. This is one greeting per join, not once for the account's lifetime.
If no message appears, open the execution logs and inspect the saved graph. Check the script's paused state, execution wire, message, and the bot's connected state. Use script debugging for the next diagnostic step.
Stop the behavior
Pause the script and save it.
Stop DocsBot_1, then start it once more.
Expect no tutorial greeting from the paused script.
Stop the bot again after the check.
Extend the graph
Read execution and data before adding a condition or a timer. Try the join-log recipe to observe the event without sending Minecraft chat.
Ostatnia aktualizacja:
Czy ta strona jest pomocna?
