The Farmer Was Replaced Sunflower Code — Max Petals, Then Power
Rewritten for 1.0+. Sunflowers pay Power. The 8× bonus only fires when you harvest the current max-petal flower while at least 10 sunflowers are on the farm. Harvest a smaller one and you lose the bonus for that harvest and the next.
How sunflowers work in 1.0+
- Plant on soil (`till()` → `Grounds.Soil`). Planting costs carrots.
- `measure()` returns petal count **7–15** (works even before fully grown).
- Harvest the largest petal count while **≥10** sunflowers exist → **8×** Power. Wrong flower → no bonus this time **and** next harvest.
- Do **not** harvest every ready flower in a simple loop — that is the most common copy-paste mistake.
Single-drone: plant, then harvest current max
python
def go_to(x, y):
while get_pos_x() != x:
if get_pos_x() < x:
move(East)
else:
move(West)
while get_pos_y() != y:
if get_pos_y() < y:
move(North)
else:
move(South)
def plant_field():
size = get_world_size()
for y in range(size):
for x in range(size):
go_to(x, y)
if get_ground_type() != Grounds.Soil:
till()
if can_harvest():
harvest()
if get_entity_type() != Entities.Sunflower:
plant(Entities.Sunflower)
if get_water() < 0.75:
use_item(Items.Water)
def harvest_current_max():
size = get_world_size()
best = 0
bx = -1
by = -1
found = False
for y in range(size):
for x in range(size):
go_to(x, y)
if get_entity_type() == Entities.Sunflower and can_harvest():
petals = measure()
if (not found) or petals > best:
best = petals
bx = x
by = y
found = True
if not found:
return False
go_to(bx, by)
harvest()
return True
clear()
while True:
plant_field()
# Keep harvesting the current max until the field is empty
while harvest_current_max():
pass Multi-drone patterns (Reddit Sep 2026)
- **No shared memory.** Spawned drones do not share globals. Collect petal maps by returning a list from each drone and reading it with `wait_for(handle)`.
- **Petal-tier sync:** spawn one drone per column; harvest only 15s, `wait_for` all, then 14s, then 13s… until the field is empty.
- **Max-15 cheese:** plant, `measure()`, if petals are under 15, harvest+replant until every tile is 15, then harvest the whole field as maxes. Fast for Power, skips sorting.