Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Function to find Soul Sand in inventory
- local function findSoulSandSlot()
- for slot = 1, 16 do
- local item = turtle.getItemDetail(slot)
- if item and item.name == "minecraft:soul_sand" then
- return slot
- end
- end
- return nil
- end
- -- Main loop
- while true do
- -- Break Soulless Sand if it's in front
- local success, data = turtle.inspect()
- if success and data.name == "forbidden_arcanus:soulless_sand" then
- print("Breaking Soulless Sand...")
- turtle.dig()
- end
- -- Attempt to place Soul Sand
- local slot = findSoulSandSlot()
- if slot then
- turtle.select(slot)
- if turtle.place() then
- print("Placed Soul Sand.")
- else
- print("Failed to place Soul Sand.")
- end
- else
- print("No Soul Sand in inventory.")
- end
- sleep(1) -- changed from 2 to 1 second
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement