AdditionalPylons

berry.lua

Sep 2nd, 2025 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. turtle.up()
  2. turtle.forward()
  3. local rotateright = true
  4. local function turn_around()
  5.     if rotateright then
  6.         turtle.turnRight()
  7.         turtle.forward()
  8.         if turtle.detect() then return 1 end
  9.         turtle.turnRight()
  10.     else
  11.         turtle.turnLeft()
  12.         if turtle.detect() then return 1 end
  13.         turtle.forward()
  14.         turtle.turnLeft()
  15.     end
  16.     rotateright = not rotateright
  17. end
  18. while true do
  19.     local is,data = turtle.inspectDown()
  20.     local justrotated = false
  21.     if is and data.name == "minecraft:sweet_berry_bush" then
  22.         if data.state.age>=2 then
  23.             turtle.digDown()
  24.             turtle.placeDown()
  25.         end
  26.     end
  27.     if turtle.detect() then
  28.         if turn_around() then break end
  29.         justrotated = true
  30.     elseif not is then
  31.         turtle.back()
  32.         if turn_around() then break end
  33.         justrotated = true
  34.     else
  35.         turtle.forward()
  36.     end
  37.     if justrotated and not turtle.detectDown() then
  38.         break
  39.     end
  40. end
  41.  
Advertisement
Add Comment
Please, Sign In to add comment