Bot state and task ownership
Understand saved state, live connections, and the lifetime of bot work.
Diese Anleitung gibt es nur auf Englisch.
Account, bot, and connection
An account is the identity that logs in to Minecraft. A bot is that account inside a SoulFire project. A connection is one live Minecraft session of that bot. The bot ID stays the same when the bot reconnects. The session changes.
Requested state and runtime state
Requested state is what you asked the SoulFire server to do: keep the bot running, or keep it stopped. Runtime state is what the bot does now, such as connecting, connected, or disconnected. The two can differ. For example, a bot can be requested to run while it is disconnected and waits to retry.
The SoulFire server stores the requested state. Closing a connection to a remote server does not stop its bots. The SDK stops bots only in the cases below.
In the SDK, the managed setup and bot.connect() clean up when their Effect scope closes.
They stop the bots that they started. Bots that were already running keep running.
They also stop the event streams that they opened. A managed local installation also stops its local server.
bot.start() only requests the running state. It does not stop the bot when your program ends.
Call bot.stop() when the bot must stop together with your program.
Actions and durable tasks
An action does one operation and returns one result. A stream sends updates while your code stays connected and reads them. A durable task runs on the SoulFire server. It can continue after the SDK connection that created it closes.
Closing the SDK scope releases its connection and local subscriptions.
Cancel a detached durable task explicitly if it must not continue.
bot.collect and call-owned run* task streams cancel unfinished work on interruption.
A surviving task still needs a running SoulFire server and bot.
The task guide describes handles, progress, cancellation, and result errors.
Reconnects
A reconnect replaces the live Minecraft session. After a reconnect, references to entities, containers, or loaded world data from the old session can be out of date. Get new references in your SDK code when the session changes. The bot ID alone does not keep them valid.
Control ownership
Movement, rotation, hands, inventory, and other bot resources can each have a different owner.
Two actions on the same bot conflict when they need the same resource.
A control lease gives a remote workflow ownership of a resource.
Inside the server, plugin ControlTask objects get resources by priority.
Avoid concurrent writers for the same bot resource. Use SDK behaviors for composed workflows or plugin control for native arbitration.
Zuletzt aktualisiert am
War diese Seite hilfreich?
