tarnovsky

bamboo harvester

Jun 6th, 2021 (edited)
505
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function harvest()
  2.     block, tag = turtle.inspect()
  3.     if(block)
  4.     then
  5.         if (tag['name'] == "minecraft:bamboo")
  6.         then
  7.             turtle.dig()
  8.             turtle.suckDown()
  9.         end
  10.     end
  11. end
  12. function move()
  13.     if(turtle.detect())
  14.     then
  15.         turtle.turnLeft()
  16.     else
  17.         turtle.forward()
  18.     end
  19. end
  20. function checkChests()
  21.     turtle.turnRight()
  22.     block, tag = turtle.inspect()
  23.     if (block)
  24.     then
  25.         if(tag['tags']['forge:chests'] == true)
  26.         then
  27.             if(turtle.getItemCount() >= 15)
  28.             then
  29.                 turtle.drop(1)
  30.             end
  31.         end
  32.     end
  33.     turtle.turnLeft()
  34. end
  35. function checkFuel()
  36.     if turtle.getFuelLevel() <= 5
  37.     then
  38.         turtle.refuel(8)
  39.     end
  40. end
  41. while(true)
  42. do
  43.     harvest()
  44.     move()
  45.     checkChests()
  46.     checkFuel()
  47.     sleep(10)
  48. end
Advertisement
Add Comment
Please, Sign In to add comment