Survival tasks
Sleep, fish, farm, and breed with durable bot tasks.
Survival tasks wait for game conditions and report a final result.
Find a bed and sleep
The durable sleep task navigates within interaction reach before it attempts sleep. It can use a specific bed or discover the nearest loaded bed, navigate into range, interact, and wait for server confirmation:
const rest = yield* bot.tasks.sleep({
searchRadius: 24,
waitUntilPossible: true,
path: {
allowMining: false,
allowPlacing: false,
},
});
const result = yield* rest.result();rest = yield from bot.tasks.sleep(
search_radius=24,
wait_until_possible=True,
options=PathfindOptions(
allow_mining=False,
allow_placing=False,
),
)
result = yield from rest.result()The bounded form fails when the server rejects sleep. Set
waitUntilPossible or wait_until_possible to keep retrying through daytime
or another temporary restriction. runSleep and run_sleep enable that
waiting behavior by default and cancel the remote task when the stream owner
disconnects.
Use the atomic TypeScript bot.sleep({ bed }) or Python
yield from bot.sleep(bed) action when the application already has an exact
reachable bed and does not need discovery or navigation. Use bot.wake() to
leave the bed.
Fish with server-timed bite detection
Fishing timing stays on the SoulFire game thread. The task selects a matching rod, casts, watches the synchronized hook state for a bite, reels in, and repeats:
const fishing = yield* bot.tasks.fish({
maximumCatches: 3,
rod: { itemIds: ["minecraft:fishing_rod"] },
restoreSelectedSlot: true,
});
const result = yield* fishing.result();fishing = yield from bot.tasks.fish(
maximum_catches=3,
rod=ItemSelector(item_ids=["minecraft:fishing_rod"]),
restore_selected_slot=True,
)
result = yield from fishing.result()The bounded form defaults to one confirmed bite and reel. runFish and
run_fish keep fishing until cancellation by default. The result reports
confirmed catches and failed casts. SoulFire reels in an active line during
cleanup and restores the previous hotbar selection when requested.
Farm and replant mature crops
The farm task scans a bounded area, walks to the nearest mature crop, uses the correct harvest interaction, and replants destructive crops:
const harvest = yield* bot.tasks.farm({
cropIds: ["minecraft:wheat", "minecraft:carrots"],
center: farmCenter,
radius: 16,
maximumHarvests: 24,
replant: true,
});
const result = yield* harvest.result();Crop selectors are block IDs. The server supports wheat, carrots, potatoes, beetroots, torchflower crops, pitcher crops, nether wart, cocoa, sweet berry bushes, and both cave-vine block variants. An empty selector includes every supported crop.
Wheat, root crops, nether wart, cocoa, torchflowers, and pitcher plants are broken and replanted with their matching item. Sweet berries and glow berries are harvested by interaction, so their plant remains in place. The task saves cocoa attachment geometry before breaking it and confirms every replant from the synchronized world state.
farm defaults to one harvest and completes when no mature crop is available.
runFarm and run_farm default to an unlimited worker that waits between
scans. A replanting worker stops with NO_REPLANT_ITEM when it cannot obtain
the required seed or crop item. Results report harvested, replanted, and failed
harvest counts.
Breed compatible animals
The breeding task selects two compatible adults in a bounded area. Without explicit selectors, it discovers eligible adult animals automatically. It finds suitable food, walks to each animal, and feeds them:
const breeding = yield* bot.tasks.breed({
animals: { entityTypes: ["minecraft:cow"] },
food: { itemIds: ["minecraft:wheat"] },
center: penCenter,
radius: 20,
maximumPairs: 2,
});
const result = yield* breeding.result();Omit animals to consider every observable animal subtype. Omit food to
let SoulFire choose any inventory item that both selected animals recognize
as breeding food. The optional selectors can narrow either side without
hard-coding food tables in the SDK. SoulFire supports same-type pairs and the
vanilla horse and donkey cross. It excludes sterile mules.
A successful entity-interaction call is not enough to count a feed. SoulFire
waits for the server's love-mode entity event for each animal. The result
therefore reports pairsStarted or pairs_started, not a guessed offspring
count. Minecraft can still delay or prevent offspring after both parents enter
love mode.
breed defaults to one pair and reports NO_COMPATIBLE_PAIR or NO_FOOD
when it cannot begin. runBreed and run_breed wait for future eligible
animals or food and continue until cancellation by default.
How is this page?
Last updated on
