Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Check and dig the block in front
- function tryDigForward()
- local success, data = turtle.inspect()
- if success and data.name == "minecraft:ancient_debris" then
- print("Found ancient debris ahead! Digging it.")
- end
- turtle.dig()
- turtle.forward()
- end
- -- Check and dig the block above
- function tryDigUp()
- local success, data = turtle.inspectUp()
- if success and data.name == "minecraft:ancient_debris" then
- print("Found ancient debris above! Digging it.")
- end
- turtle.digUp()
- end
- -- Check and dig the block below
- function tryDigDown()
- local success, data = turtle.inspectDown()
- if success and data.name == "minecraft:ancient_debris" then
- print("Found ancient debris below! Digging it.")
- end
- turtle.digDown()
- end
- -- Dig a straight tunnel and check for ancient debris
- function digTunnel(length)
- for i = 1, length do
- tryDigForward()
- tryDigUp()
- tryDigDown()
- end
- end
- -- Start the program
- print("Starting tunnel excavation in search of ancient debris...")
- digTunnel(5) -- You can increase or decrease the length
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement