JGET

explore

harvestlib

Downloads
0
Created On
4/13/2024
Last Updated
4/13/2024

Install this package:

$ jget get harvestlib

Function harvestField takes three parameters:

  • cropName: the name of the crop you want to harvest
  • harvestFunction: a Lua function that defines when and how the crop should be harvested, as well as how to replant the crop if required
  • storageFunction: a Lua function that defines where the items harvested should be stored. This will usually be the directions to a chest, and back to the starting position

The method expects the turtle to start facing forwards, on the lower-right corner of the field. This is also where it will end up after harvesting the field, and where it should end up after the storageFunction has finished running.

The method is able to refuel the turtle if there is fuel in its inventory.

The field should be surrounded on all sides by blocks. The blocks should not have any objects placed on them, as that might interfere with the movement.

The inside of the field should only contain the crop you want to harvest and fluids, as other types of blocks will interfere with the movement.