The Farmer Was Replaced Carrot Code — Till, Plant, Water
Rewritten for 1.0+. Carrots need tilled soil. There is no seed shop: `plant(Entities.Carrot)` spends hay and wood from inventory. `trade()` was removed from the game.
1.0 carrot rules (outdated tips to ignore)
- `plant(Entities.Carrot)` fails unless `get_ground_type() == Grounds.Soil`. Call `till()` on Grassland. Calling `till()` again turns Soil back to Grassland.
- **No `Items.Carrot_Seed`.** Planting costs hay + wood automatically. Check with `get_cost(Entities.Carrot)` (amounts scale with carrot upgrades).
- **No `trade()`.** Water accrues automatically every 10s. Water with `use_item(Items.Water)` (old name `Items.Water_Tank` was renamed).
- `get_water()` is 0–1. Growth scales up to 5× at water level 1. Skip watering until you unlock Watering.
Copy-paste carrot loop (verified 1.0 APIs)
python
while True:
if can_harvest():
harvest()
if get_ground_type() != Grounds.Soil:
till()
# Optional: only plant if you can afford it
cost = get_cost(Entities.Carrot)
can_pay = True
for item in cost:
if num_items(item) < cost[item]:
can_pay = False
if can_pay:
plant(Entities.Carrot)
if get_water() < 0.75:
use_item(Items.Water)
move(East)
if get_pos_x() == 0:
move(North) If `get_cost` / `Unlocks.Costs` is not unlocked yet, delete the cost block and call `plant(Entities.Carrot)` directly — it still spends hay+wood when you have them.
Next crops
Pumpkins also need soil and cost carrots to plant; ~20% die as Dead_Pumpkin. Trees need a checkerboard so neighbors do not double grow time.